inetutils: don't guess target paths
PATCH v2 1/3 inetutils: don't guess target paths
From: Ross Burton <[email protected]>
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.
--- .../inetutils-1.9-PATH_PROCNET_DEV.patch | 37 ------------------- .../inetutils/inetutils_2.4.bb | 21 +++++++++-- 2 files changed, 18 insertions(+), 40 deletions(-) delete mode 100644 meta/recipes-connectivity/inetutils/inetutils/inetutils-1.9-PATH_PROCNET_DEV.patch
meta/recipes-connectivity/inetutils/inetutils/inetutils-1.9-PATH_PROCNET_DEV.patch deleted +0 -37
@@ -1,37 +0,0 @@ -From 101130f422dd5c01a1459645d7b2a5b8d19720ab Mon Sep 17 00:00:00 2001 -From: Martin Jansa <[email protected]> -Date: Wed, 6 Mar 2019 09:36:11 -0500 -Subject: [PATCH] inetutils: define PATH_PROCNET_DEV if not already defined -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -this prevents the following compilation error : -system/linux.c:401:15: error: 'PATH_PROCNET_DEV' undeclared (first use in this function) - -this patch comes from : - http://repository.timesys.com/buildsources/i/inetutils/inetutils-1.9/ - -Upstream-Status: Inappropriate [not author] - -Signed-of-by: Eric Bénard <[email protected]> - ---- - ifconfig/system/linux.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/ifconfig/system/linux.c b/ifconfig/system/linux.c -index e453b46..4268ca9 100644 ---- a/ifconfig/system/linux.c -+++ b/ifconfig/system/linux.c -@@ -53,6 +53,10 @@ - #include "../ifconfig.h" - - -+#ifndef PATH_PROCNET_DEV -+ #define PATH_PROCNET_DEV "/proc/net/dev" -+#endif -+ - /* ARPHRD stuff. */ - - static void
meta/recipes-connectivity/inetutils/inetutils_2.4.bb +18 -3
@@ -20,7 +20,6 @@ SRC_URI = "${GNU_MIRROR}/inetutils/inetutils-${PV}.tar.xz \ file://rsh.xinetd.inetutils \ file://telnet.xinetd.inetutils \ file://tftpd.xinetd.inetutils \ - file://inetutils-1.9-PATH_PROCNET_DEV.patch \ file://inetutils-only-check-pam_appl.h-when-pam-enabled.patch \ file://0001-CVE-2023-40303-ftpd-rcp-rlogin-rsh-rshd-uucpd-fix-ch.patch \ 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," PACKAGECONFIG[ping6] = "--enable-ping6,--disable-ping6," EXTRA_OECONF = "--with-ncurses-include-dir=${STAGING_INCDIR} \ - inetutils_cv_path_login=${base_bindir}/login \ --with-libreadline-prefix=${STAGING_LIBDIR} \ --enable-rpath=no \ -" + --with-path-login=${base_bindir}/login \ + --with-path-cp=${base_bindir}/cp \ + --with-path-uucico=${libexecdir}/uuico \ + --with-path-procnet-dev=/proc/net/dev \ + " + +EXTRA_OECONF:append:libc-musl = " --with-path-utmpx=/dev/null/utmpx --with-path-wtmpx=/dev/null/wtmpx" # These are horrible for security, disable them EXTRA_OECONF:append = " --disable-rsh --disable-rshd --disable-rcp \ --disable-rlogin --disable-rlogind --disable-rexec --disable-rexecd" +# The configure script guesses many paths in cross builds, check for this happening +do_configure_cross_check() { + if grep "may be incorrect because of cross-compilation" ${B}/config.log; then + bberror Default path values used, these must be set explicitly + fi +} +do_configure[postfuncs] += "do_configure_cross_check" + +# The --with-path options are not actually options, so this check needs to be silenced +ERROR_QA:remove = "unknown-configure-option" + do_configure:prepend () { export HELP2MAN='true' cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${S}/build-aux/config.rpath
Signature · 1 line
2.34.1
PATCH v2 2/3 inetutils: remove obsolete patches
From: Ross Burton <[email protected]>
fix-disable-ipv6.patch: we don't support uclibc, and most libcs don't have optional support for IPv6.
inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch and inetutils-1.8-0003-wchar.patch: these don't appear to be needed anymore.
inetutils-only-check-pam_appl.h-when-pam-enabled.patch: configure.ac doesn't fail if PAM is disabled anymore.
--- .../inetutils/fix-disable-ipv6.patch | 85 ------------------- ...rse-pull-in-features.h-for-__GLIBC__.patch | 27 ------ .../inetutils/inetutils-1.8-0003-wchar.patch | 25 ------ ...ly-check-pam_appl.h-when-pam-enabled.patch | 49 ----------- .../inetutils/inetutils_2.4.bb | 4 - 5 files changed, 190 deletions(-) delete mode 100644 meta/recipes-connectivity/inetutils/inetutils/fix-disable-ipv6.patch delete mode 100644 meta/recipes-connectivity/inetutils/inetutils/inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch delete mode 100644 meta/recipes-connectivity/inetutils/inetutils/inetutils-1.8-0003-wchar.patch delete mode 100644 meta/recipes-connectivity/inetutils/inetutils/inetutils-only-check-pam_appl.h-when-pam-enabled.patch
meta/recipes-connectivity/inetutils/inetutils/fix-disable-ipv6.patch deleted +0 -85
@@ -1,85 +0,0 @@ -From c7c27ba763c613f83c1561e56448b49315c271c5 Mon Sep 17 00:00:00 2001 -From: Jackie Huang <[email protected]> -Date: Wed, 6 Mar 2019 09:36:11 -0500 -Subject: [PATCH] Upstream: - http://www.mail-archive.com/[email protected]/msg02103.html - -Upstream-Status: Pending - -Signed-off-by: Jackie Huang <[email protected]> - ---- - ping/ping_common.h | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -diff --git a/ping/ping_common.h b/ping/ping_common.h -index 65e3e60..3e84db0 100644 ---- a/ping/ping_common.h -+++ b/ping/ping_common.h -@@ -18,10 +18,14 @@ - You should have received a copy of the GNU General Public License - along with this program. If not, see `http://www.gnu.org/licenses/'. */ - -+#include <config.h> -+ - #include <netinet/in_systm.h> - #include <netinet/in.h> - #include <netinet/ip.h> -+#ifdef HAVE_IPV6 - #include <netinet/icmp6.h> -+#endif - #include <icmp.h> - #include <error.h> - #include <progname.h> -@@ -63,7 +67,12 @@ struct ping_stat - want to follow the traditional behaviour of ping. */ - #define DEFAULT_PING_COUNT 0 - -+#ifdef HAVE_IPV6 - #define PING_HEADER_LEN (USE_IPV6 ? sizeof (struct icmp6_hdr) : ICMP_MINLEN) -+#else -+#define PING_HEADER_LEN (ICMP_MINLEN) -+#endif -+ - #define PING_TIMING(s) ((s) >= sizeof (struct timeval)) - #define PING_DATALEN (64 - PING_HEADER_LEN) /* default data length */ - -@@ -78,13 +87,20 @@ struct ping_stat - - #define PING_MIN_USER_INTERVAL (200000/PING_PRECISION) - -+#ifdef HAVE_IPV6 - /* FIXME: Adjust IPv6 case for options and their consumption. */ - #define _PING_BUFLEN(p, u) ((u)? ((p)->ping_datalen + sizeof (struct icmp6_hdr)) : \ - (MAXIPLEN + (p)->ping_datalen + ICMP_TSLEN)) - -+#else -+#define _PING_BUFLEN(p, u) (MAXIPLEN + (p)->ping_datalen + ICMP_TSLEN) -+#endif -+ -+#ifdef HAVE_IPV6 - typedef int (*ping_efp6) (int code, void *closure, struct sockaddr_in6 * dest, - struct sockaddr_in6 * from, struct icmp6_hdr * icmp, - int datalen); -+#endif - - typedef int (*ping_efp) (int code, - void *closure, -@@ -93,13 +109,17 @@ typedef int (*ping_efp) (int code, - struct ip * ip, icmphdr_t * icmp, int datalen); - - union event { -+#ifdef HAVE_IPV6 - ping_efp6 handler6; -+#endif - ping_efp handler; - }; - - union ping_address { - struct sockaddr_in ping_sockaddr; -+#ifdef HAVE_IPV6 - struct sockaddr_in6 ping_sockaddr6; -+#endif - }; - - typedef struct ping_data PING;
meta/recipes-connectivity/inetutils/inetutils/inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch deleted +0 -27
@@ -1,27 +0,0 @@ -From f7f785c21306010b2367572250b2822df5bc7728 Mon Sep 17 00:00:00 2001 -From: Mike Frysinger <vapier at gentoo.org> -Date: Thu, 18 Nov 2010 16:59:14 -0500 -Subject: [PATCH] printf-parse: pull in features.h for __GLIBC__ - -Upstream-Status: Pending - -Signed-off-by: Mike Frysinger <vapier at gentoo.org> - ---- - lib/printf-parse.h | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/lib/printf-parse.h b/lib/printf-parse.h -index e7d0f82..d7b4534 100644 ---- a/lib/printf-parse.h -+++ b/lib/printf-parse.h -@@ -28,6 +28,9 @@ - - #include "printf-args.h" - -+#ifdef HAVE_FEATURES_H -+# include <features.h> /* for __GLIBC__ */ -+#endif - - /* Flags */ - #define FLAG_GROUP 1 /* ' flag */
meta/recipes-connectivity/inetutils/inetutils/inetutils-1.8-0003-wchar.patch deleted +0 -25
@@ -1,25 +0,0 @@ -From 9089c6eafbf5903174dce87b68476e35db80beb9 Mon Sep 17 00:00:00 2001 -From: Martin Jansa <[email protected]> -Date: Wed, 6 Mar 2019 09:36:11 -0500 -Subject: [PATCH] inetutils: Import version 1.9.4 - -Upstream-Status: Pending - ---- - lib/wchar.in.h | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/lib/wchar.in.h b/lib/wchar.in.h -index cdda680..043866a 100644 ---- a/lib/wchar.in.h -+++ b/lib/wchar.in.h -@@ -77,6 +77,9 @@ - /* The include_next requires a split double-inclusion guard. */ - #if @HAVE_WCHAR_H@ - # @INCLUDE_NEXT@ @NEXT_WCHAR_H@ -+#else -+# include <stddef.h> -+# define MB_CUR_MAX 1 - #endif - - #undef _GL_ALREADY_INCLUDING_WCHAR_H
meta/recipes-connectivity/inetutils/inetutils/inetutils-only-check-pam_appl.h-when-pam-enabled.patch deleted +0 -49
49 lines not on this page · raw message
meta/recipes-connectivity/inetutils/inetutils_2.4.bb +0 -4
@@ -13,17 +13,13 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=0c7051aef9219dc7237f206c5c4179a7" SRC_URI[sha256sum] = "1789d6b1b1a57dfe2a7ab7b533ee9f5dfd9cbf5b59bb1bb3c2612ed08d0f68b2" SRC_URI = "${GNU_MIRROR}/inetutils/inetutils-${PV}.tar.xz \ - file://inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch \ - file://inetutils-1.8-0003-wchar.patch \ file://rexec.xinetd.inetutils \ file://rlogin.xinetd.inetutils \ file://rsh.xinetd.inetutils \ file://telnet.xinetd.inetutils \ file://tftpd.xinetd.inetutils \ - file://inetutils-only-check-pam_appl.h-when-pam-enabled.patch \ file://0001-CVE-2023-40303-ftpd-rcp-rlogin-rsh-rshd-uucpd-fix-ch.patch \ file://0002-CVE-2023-40303-Indent-changes-in-previous-commit.patch \ - ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', '', 'file://fix-disable-ipv6.patch', d)} \ " inherit autotools gettext update-alternatives texinfo
Signature · 1 line
2.34.1
PATCH v2 3/3 inetutils: remove obsolete cruft from do_configure
In reply to [email protected]From: Ross Burton <[email protected]>
glob/ doesn't exist and the other files are copied by autotools.bbclass
--- meta/recipes-connectivity/inetutils/inetutils_2.4.bb | 4 ---- 1 file changed, 4 deletions(-)
meta/recipes-connectivity/inetutils/inetutils_2.4.bb +0 -4
@@ -64,10 +64,6 @@ ERROR_QA:remove = "unknown-configure-option" do_configure:prepend () { export HELP2MAN='true' - cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${S}/build-aux/config.rpath - install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S} - install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S} - rm -f ${S}/glob/configure* } do_install:append () {
Signature · 1 line
2.34.1