summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2023-08-31 12:22:48 +0100
committerSteve Sakoman <steve@sakoman.com>2023-10-04 05:21:28 -1000
commitc559b2cc3622d2c501b8a88152fd4ed3b95ec574 (patch)
tree11306e6855c0becf09355440630589c60683824c
parent6ecbb1a032f435f8e76ce90b9482e2cf2b2dd141 (diff)
downloadpoky-c559b2cc3622d2c501b8a88152fd4ed3b95ec574.tar.gz
inetutils: don't guess target paths
inetutils guesses a lot of target paths in cross builds, and warns that some of them are known to be wrong (for example, whether /proc/net/dev exists is guessed as 'no'). Add a post-configure function to check for these warnings, and pass --with-path-* as appropriate to set the paths explicitly. This means we can remove the patch which was setting PATH_PROCNET_DEV, and the autoconf cache value inetutils_cv_path_login. The downside is that these --with-path-* options are not real autoconf options, so the "unknown options" warning is emitted. Losing those is an acceptable compromise, so disable it. Musl doesn't implement utmp and has stub defines for _PATH_UTMP but not _PATH_UTMPX, so we need to set the X variants explicitly. (From OE-Core rev: 86b88aaec534c3da74de6127198c57521977bd10) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 91179f89db127063dbdf998e15d63e04d6be53f7) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/recipes-connectivity/inetutils/inetutils/inetutils-1.9-PATH_PROCNET_DEV.patch37
-rw-r--r--meta/recipes-connectivity/inetutils/inetutils_2.4.bb21
2 files changed, 18 insertions, 40 deletions
diff --git a/meta/recipes-connectivity/inetutils/inetutils/inetutils-1.9-PATH_PROCNET_DEV.patch b/meta/recipes-connectivity/inetutils/inetutils/inetutils-1.9-PATH_PROCNET_DEV.patch
deleted file mode 100644
index 460ddf9830..0000000000
--- a/meta/recipes-connectivity/inetutils/inetutils/inetutils-1.9-PATH_PROCNET_DEV.patch
+++ /dev/null
@@ -1,37 +0,0 @@
1From 101130f422dd5c01a1459645d7b2a5b8d19720ab Mon Sep 17 00:00:00 2001
2From: Martin Jansa <martin.jansa@gmail.com>
3Date: Wed, 6 Mar 2019 09:36:11 -0500
4Subject: [PATCH] inetutils: define PATH_PROCNET_DEV if not already defined
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9this prevents the following compilation error :
10system/linux.c:401:15: error: 'PATH_PROCNET_DEV' undeclared (first use in this function)
11
12this patch comes from :
13 http://repository.timesys.com/buildsources/i/inetutils/inetutils-1.9/
14
15Upstream-Status: Inappropriate [not author]
16
17Signed-of-by: Eric Bénard <eric@eukrea.com>
18
19---
20 ifconfig/system/linux.c | 4 ++++
21 1 file changed, 4 insertions(+)
22
23diff --git a/ifconfig/system/linux.c b/ifconfig/system/linux.c
24index e453b46..4268ca9 100644
25--- a/ifconfig/system/linux.c
26+++ b/ifconfig/system/linux.c
27@@ -53,6 +53,10 @@
28 #include "../ifconfig.h"
29
30
31+#ifndef PATH_PROCNET_DEV
32+ #define PATH_PROCNET_DEV "/proc/net/dev"
33+#endif
34+
35 /* ARPHRD stuff. */
36
37 static void
diff --git a/meta/recipes-connectivity/inetutils/inetutils_2.4.bb b/meta/recipes-connectivity/inetutils/inetutils_2.4.bb
index 032c0d6b24..d3d65e1469 100644
--- a/meta/recipes-connectivity/inetutils/inetutils_2.4.bb
+++ b/meta/recipes-connectivity/inetutils/inetutils_2.4.bb
@@ -19,7 +19,6 @@ SRC_URI = "${GNU_MIRROR}/inetutils/inetutils-${PV}.tar.xz \
19 file://rsh.xinetd.inetutils \ 19 file://rsh.xinetd.inetutils \
20 file://telnet.xinetd.inetutils \ 20 file://telnet.xinetd.inetutils \
21 file://tftpd.xinetd.inetutils \ 21 file://tftpd.xinetd.inetutils \
22 file://inetutils-1.9-PATH_PROCNET_DEV.patch \
23 file://inetutils-only-check-pam_appl.h-when-pam-enabled.patch \ 22 file://inetutils-only-check-pam_appl.h-when-pam-enabled.patch \
24 file://0001-CVE-2023-40303-ftpd-rcp-rlogin-rsh-rshd-uucpd-fix-ch.patch \ 23 file://0001-CVE-2023-40303-ftpd-rcp-rlogin-rsh-rshd-uucpd-fix-ch.patch \
25 file://0002-CVE-2023-40303-Indent-changes-in-previous-commit.patch \ 24 file://0002-CVE-2023-40303-Indent-changes-in-previous-commit.patch \
@@ -42,15 +41,31 @@ PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6 gl_cv_socket_ipv6=no,"
42PACKAGECONFIG[ping6] = "--enable-ping6,--disable-ping6," 41PACKAGECONFIG[ping6] = "--enable-ping6,--disable-ping6,"
43 42
44EXTRA_OECONF = "--with-ncurses-include-dir=${STAGING_INCDIR} \ 43EXTRA_OECONF = "--with-ncurses-include-dir=${STAGING_INCDIR} \
45 inetutils_cv_path_login=${base_bindir}/login \
46 --with-libreadline-prefix=${STAGING_LIBDIR} \ 44 --with-libreadline-prefix=${STAGING_LIBDIR} \
47 --enable-rpath=no \ 45 --enable-rpath=no \
48" 46 --with-path-login=${base_bindir}/login \
47 --with-path-cp=${base_bindir}/cp \
48 --with-path-uucico=${libexecdir}/uuico \
49 --with-path-procnet-dev=/proc/net/dev \
50 "
51
52EXTRA_OECONF:append:libc-musl = " --with-path-utmpx=/dev/null/utmpx --with-path-wtmpx=/dev/null/wtmpx"
49 53
50# These are horrible for security, disable them 54# These are horrible for security, disable them
51EXTRA_OECONF:append = " --disable-rsh --disable-rshd --disable-rcp \ 55EXTRA_OECONF:append = " --disable-rsh --disable-rshd --disable-rcp \
52 --disable-rlogin --disable-rlogind --disable-rexec --disable-rexecd" 56 --disable-rlogin --disable-rlogind --disable-rexec --disable-rexecd"
53 57
58# The configure script guesses many paths in cross builds, check for this happening
59do_configure_cross_check() {
60 if grep "may be incorrect because of cross-compilation" ${B}/config.log; then
61 bberror Default path values used, these must be set explicitly
62 fi
63}
64do_configure[postfuncs] += "do_configure_cross_check"
65
66# The --with-path options are not actually options, so this check needs to be silenced
67ERROR_QA:remove = "unknown-configure-option"
68
54do_configure:prepend () { 69do_configure:prepend () {
55 export HELP2MAN='true' 70 export HELP2MAN='true'
56 cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${S}/build-aux/config.rpath 71 cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${S}/build-aux/config.rpath