From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH] ppp: Update to include bug fixes that should be in 2.5.1 but not yet released Date: Fri, 15 Mar 2024 13:38:06 +0100 Message-ID: <20240315123806.210103-1-adolf.belka@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1057527150484415977==" List-Id: --===============1057527150484415977== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable - Update from version 2.5.0 to commit e1266c7 - Update of rootfile - When ppp-2.5.0 was released it had a bug bin it that the lock and run direc= tories had non standard defaults but also that if the directory did not exist ppp= just ignored it and continued to start but would then have error messages in th= e logs about not being able to cretae the lock file - This issue was raised in the ppp github issues and a set of patches merged = into ppp. - The plan was written in Nov 2023 that this would be released as 2.5.1, howe= ver nearly three months later there is no sight of 2.5.1 being released and people co= ntinue to flag up the lock directory issues and have to apply a workaround to create= the directory in local.rc - This patch has taken the zip source tarball of master at the commit e1266c7= . The zip tarball was then extracted and then tar'd back up as a tar.gz file with th= e version set at e1266c7 rather than master. I could not find any other way to get a sou= rce tarball\ created at a certain commit stage. - The patch ppp-2.5.0-2-everywhere-O_CLOEXEC-harder.patch had to be updated d= ue to some changes in the source files. - The patch ppp-2.5.0-7-add-configure-check-to-see-if-we-have-struct-sockaddr= _ll.patch was removed as the changes are now built into the source tarball. - This will need to be tested thoroughly by people with ppp to confirm that t= he lock directory is created if it doesn't exist on the system. I can't test that = as I have no access to a ppp connection system. - For a view of the changelog between 2.5.0 and e1266c7 the github commits li= st needs to be reviewed. https://github.com/ppp-project/ppp/commits/master/?before=3De= 1266c76d1ad39f98f11676e34f180f78c5a510c+35 Signed-off-by: Adolf Belka --- config/rootfiles/common/ppp | 46 +++++------ lfs/ppp | 10 +-- ...to-see-if-we-have-struct-sockaddr_ll.patch | 37 --------- ...266c7-2-everywhere-O_CLOEXEC-harder.patch} | 82 +++++++++---------- 4 files changed, 69 insertions(+), 106 deletions(-) delete mode 100644 src/patches/ppp/ppp-2.5.0-7-add-configure-check-to-see-if= -we-have-struct-sockaddr_ll.patch rename src/patches/ppp/{ppp-2.5.0-2-everywhere-O_CLOEXEC-harder.patch =3D> p= pp-e1266c7-2-everywhere-O_CLOEXEC-harder.patch} (75%) diff --git a/config/rootfiles/common/ppp b/config/rootfiles/common/ppp index 379c64af4..6a27af3e7 100644 --- a/config/rootfiles/common/ppp +++ b/config/rootfiles/common/ppp @@ -35,29 +35,29 @@ etc/ppp/standardloginscript #usr/include/pppd/upap.h #usr/lib/pkgconfig/pppd.pc usr/lib/pppd -usr/lib/pppd/2.5.0 -#usr/lib/pppd/2.5.0/minconn.la -usr/lib/pppd/2.5.0/minconn.so -#usr/lib/pppd/2.5.0/openl2tp.la -usr/lib/pppd/2.5.0/openl2tp.so -#usr/lib/pppd/2.5.0/passprompt.la -usr/lib/pppd/2.5.0/passprompt.so -#usr/lib/pppd/2.5.0/passwordfd.la -usr/lib/pppd/2.5.0/passwordfd.so -#usr/lib/pppd/2.5.0/pppoatm.la -usr/lib/pppd/2.5.0/pppoatm.so -#usr/lib/pppd/2.5.0/pppoe.la -usr/lib/pppd/2.5.0/pppoe.so -#usr/lib/pppd/2.5.0/pppol2tp.la -usr/lib/pppd/2.5.0/pppol2tp.so -#usr/lib/pppd/2.5.0/radattr.la -usr/lib/pppd/2.5.0/radattr.so -#usr/lib/pppd/2.5.0/radius.la -usr/lib/pppd/2.5.0/radius.so -#usr/lib/pppd/2.5.0/radrealms.la -usr/lib/pppd/2.5.0/radrealms.so -#usr/lib/pppd/2.5.0/winbind.la -usr/lib/pppd/2.5.0/winbind.so +#usr/lib/pppd/2.5.1-dev +#usr/lib/pppd/2.5.1-dev/minconn.la +usr/lib/pppd/2.5.1-dev/minconn.so +#usr/lib/pppd/2.5.1-dev/openl2tp.la +usr/lib/pppd/2.5.1-dev/openl2tp.so +#usr/lib/pppd/2.5.1-dev/passprompt.la +usr/lib/pppd/2.5.1-dev/passprompt.so +#usr/lib/pppd/2.5.1-dev/passwordfd.la +usr/lib/pppd/2.5.1-dev/passwordfd.so +#usr/lib/pppd/2.5.1-dev/pppoatm.la +usr/lib/pppd/2.5.1-dev/pppoatm.so +#usr/lib/pppd/2.5.1-dev/pppoe.la +usr/lib/pppd/2.5.1-dev/pppoe.so +#usr/lib/pppd/2.5.1-dev/pppol2tp.la +usr/lib/pppd/2.5.1-dev/pppol2tp.so +#usr/lib/pppd/2.5.1-dev/radattr.la +usr/lib/pppd/2.5.1-dev/radattr.so +#usr/lib/pppd/2.5.1-dev/radius.la +usr/lib/pppd/2.5.1-dev/radius.so +#usr/lib/pppd/2.5.1-dev/radrealms.la +usr/lib/pppd/2.5.1-dev/radrealms.so +#usr/lib/pppd/2.5.1-dev/winbind.la +usr/lib/pppd/2.5.1-dev/winbind.so usr/sbin/chat usr/sbin/pppd usr/sbin/pppdump diff --git a/lfs/ppp b/lfs/ppp index 54aa1caf5..a16859002 100644 --- a/lfs/ppp +++ b/lfs/ppp @@ -1,7 +1,7 @@ ############################################################################= ### # = # # IPFire.org - A linux based firewall = # -# Copyright (C) 2007-2023 IPFire Team = # +# Copyright (C) 2007-2024 IPFire Team = # # = # # This program is free software: you can redistribute it and/or modify = # # it under the terms of the GNU General Public License as published by = # @@ -24,7 +24,7 @@ =20 include Config =20 -VER =3D 2.5.0 +VER =3D e1266c7 =20 THISAPP =3D ppp-$(VER) DL_FILE =3D $(THISAPP).tar.gz @@ -42,7 +42,7 @@ objects =3D $(DL_FILE) =20 $(DL_FILE) =3D $(DL_FROM)/$(DL_FILE) =20 -$(DL_FILE)_BLAKE2 =3D 6a0e9efcbff3cb499705071cc7d0e3411cf4871fd53b2bfedbb1f2= cf3ad80728eb436050cf33b78e36d473be64f15907a21da17f283337455f0af379bc18272d +$(DL_FILE)_BLAKE2 =3D be60fadeed632ae2511e2d60148905da9868bd4271139b4fecab6b= 4b93e4a403e645d84204f907a8661748fb1a18b59c893925d91565520b9af791a45b0aaf4f =20 install : $(TARGET) =20 @@ -72,13 +72,13 @@ $(subst %,%_BLAKE2,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && ./autogen.sh cd $(DIR_APP) && patch -Np0 -i $(DIR_SRC)/src/patches/ppp/ppp-2.5.0-1-we-do= n-t-want-to-accidentally-leak-fds.patch - cd $(DIR_APP) && patch -Np0 -i $(DIR_SRC)/src/patches/ppp/ppp-2.5.0-2-every= where-O_CLOEXEC-harder.patch + cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/ppp/ppp-e1266c7-2-eve= rywhere-O_CLOEXEC-harder.patch cd $(DIR_APP) && patch -Np0 -i $(DIR_SRC)/src/patches/ppp/ppp-2.5.0-3-every= where-use-SOCK_CLOEXEC-when-creating-socket.patch cd $(DIR_APP) && patch -Np0 -i $(DIR_SRC)/src/patches/ppp/ppp-2.5.0-4-incre= ase-max-padi-attempts.patch cd $(DIR_APP) && patch -Np0 -i $(DIR_SRC)/src/patches/ppp/ppp-2.5.0-5-heade= rs_4.9.patch cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/ppp/ppp-2.5.0-6-patch= -configure-to-handle-cflags-properly.patch - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/ppp/ppp-2.5.0-7-add-c= onfigure-check-to-see-if-we-have-struct-sockaddr_ll.patch cd $(DIR_APP) && ./configure \ --prefix=3D/usr \ --sysconfdir=3D/etc \ diff --git a/src/patches/ppp/ppp-2.5.0-7-add-configure-check-to-see-if-we-hav= e-struct-sockaddr_ll.patch b/src/patches/ppp/ppp-2.5.0-7-add-configure-check-= to-see-if-we-have-struct-sockaddr_ll.patch deleted file mode 100644 index a7823d424..000000000 --- a/src/patches/ppp/ppp-2.5.0-7-add-configure-check-to-see-if-we-have-struc= t-sockaddr_ll.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 9d6d326b2530cffb1414e4c401675117c42d43ce Mon Sep 17 00:00:00 2001 -From: Eivind Naess -Date: Sun, 23 Apr 2023 11:30:43 -0700 -Subject: [PATCH] Add configure check to see if we have struct sockaddr_ll - -Fixes issue #411. - -Signed-off-by: Eivind Naess ---- - configure.ac | 3 ++- - pppd/plugins/pppoe/config.h.in | 2 ++ - 2 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 1180f64ec..38b24af92 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -75,7 +75,8 @@ AM_COND_IF([LINUX], [ - linux/if_ether.h \ - linux/if_packet.h \ - netinet/if_ether.h \ -- netpacket/packet.h])]) -+ netpacket/packet.h]) -+ AC_CHECK_TYPES([struct sockaddr_ll], [], [], [#include ])]) -=20 - AC_CHECK_SIZEOF(unsigned int) - AC_CHECK_SIZEOF(unsigned long) -diff --git a/pppd/plugins/pppoe/config.h.in b/pppd/plugins/pppoe/config.h.in -index d447f5e89..d7d61c01c 100644 ---- a/pppd/plugins/pppoe/config.h.in -+++ b/pppd/plugins/pppoe/config.h.in -@@ -69,3 +69,5 @@ - /* The size of `unsigned short', as computed by sizeof. */ - #undef SIZEOF_UNSIGNED_SHORT -=20 -+/* Define to 1 if the system has the type `struct sockaddr_ll'. */ -+#undef HAVE_STRUCT_SOCKADDR_LL diff --git a/src/patches/ppp/ppp-2.5.0-2-everywhere-O_CLOEXEC-harder.patch b/= src/patches/ppp/ppp-e1266c7-2-everywhere-O_CLOEXEC-harder.patch similarity index 75% rename from src/patches/ppp/ppp-2.5.0-2-everywhere-O_CLOEXEC-harder.patch rename to src/patches/ppp/ppp-e1266c7-2-everywhere-O_CLOEXEC-harder.patch index c205c0e08..b6fd842a7 100644 --- a/src/patches/ppp/ppp-2.5.0-2-everywhere-O_CLOEXEC-harder.patch +++ b/src/patches/ppp/ppp-e1266c7-2-everywhere-O_CLOEXEC-harder.patch @@ -1,6 +1,6 @@ -diff -Naur pppd.orig/eap.c pppd/eap.c ---- pppd.orig/eap.c 2023-03-25 05:38:30.000000000 +0100 -+++ pppd/eap.c 2023-06-30 12:58:07.984676045 +0200 +diff -Naur ppp-e1266c7-orig/pppd/eap.c ppp-e1266c7/pppd/eap.c +--- ppp-e1266c7-orig/pppd/eap.c 2024-02-13 10:40:56.000000000 +0100 ++++ ppp-e1266c7/pppd/eap.c 2024-03-15 10:40:53.637190252 +0100 @@ -1542,7 +1542,7 @@ =20 if ((path =3D name_of_pn_file()) =3D=3D NULL) @@ -10,10 +10,10 @@ diff -Naur pppd.orig/eap.c pppd/eap.c err =3D errno; free(path); errno =3D err; -diff -Naur pppd.orig/main.c pppd/main.c ---- pppd.orig/main.c 2023-03-25 05:38:30.000000000 +0100 -+++ pppd/main.c 2023-06-30 13:00:15.155195676 +0200 -@@ -479,7 +479,7 @@ +diff -Naur ppp-e1266c7-orig/pppd/main.c ppp-e1266c7/pppd/main.c +--- ppp-e1266c7-orig/pppd/main.c 2024-02-13 10:40:56.000000000 +0100 ++++ ppp-e1266c7/pppd/main.c 2024-03-15 10:41:43.842037617 +0100 +@@ -480,7 +480,7 @@ die(0); =20 /* Make sure fds 0, 1, 2 are open to somewhere. */ @@ -22,10 +22,10 @@ diff -Naur pppd.orig/main.c pppd/main.c if (fd_devnull < 0) fatal("Couldn't open %s: %m", PPP_DEVNULL); while (fd_devnull <=3D 2) { -diff -Naur pppd.orig/options.c pppd/options.c ---- pppd.orig/options.c 2023-06-30 12:42:19.262593140 +0200 -+++ pppd/options.c 2023-06-30 13:01:58.388323345 +0200 -@@ -1718,9 +1718,9 @@ +diff -Naur ppp-e1266c7-orig/pppd/options.c ppp-e1266c7/pppd/options.c +--- ppp-e1266c7-orig/pppd/options.c 2024-02-13 10:40:56.000000000 +0100 ++++ ppp-e1266c7/pppd/options.c 2024-03-15 10:43:02.867753370 +0100 +@@ -1719,9 +1719,9 @@ ppp_option_error("unable to drop permissions to open %s: %m", *argv); return 0; } @@ -37,10 +37,10 @@ diff -Naur pppd.orig/options.c pppd/options.c err =3D errno; if (!privileged_option && seteuid(euid) =3D=3D -1) fatal("unable to regain privileges: %m"); -diff -Naur pppd.orig/sys-linux.c pppd/sys-linux.c ---- pppd.orig/sys-linux.c 2023-06-30 12:43:20.634453475 +0200 -+++ pppd/sys-linux.c 2023-06-30 13:11:25.715511251 +0200 -@@ -666,7 +666,7 @@ +diff -Naur ppp-e1266c7-orig/pppd/sys-linux.c ppp-e1266c7/pppd/sys-linux.c +--- ppp-e1266c7-orig/pppd/sys-linux.c 2024-02-13 10:40:56.000000000 +0100 ++++ ppp-e1266c7/pppd/sys-linux.c 2024-03-15 10:49:59.310297165 +0100 +@@ -656,7 +656,7 @@ goto err; } dbglog("using channel %d", chindex); @@ -49,7 +49,7 @@ diff -Naur pppd.orig/sys-linux.c pppd/sys-linux.c if (fd < 0) { error("Couldn't reopen /dev/ppp: %m"); goto err; -@@ -904,7 +904,7 @@ +@@ -894,7 +894,7 @@ dbglog("in make_ppp_unit, already had /dev/ppp open?"); close(ppp_dev_fd); } @@ -58,7 +58,7 @@ diff -Naur pppd.orig/sys-linux.c pppd/sys-linux.c if (ppp_dev_fd < 0) fatal("Couldn't open /dev/ppp: %m"); flags =3D fcntl(ppp_dev_fd, F_GETFL); -@@ -1025,7 +1025,7 @@ +@@ -1015,7 +1015,7 @@ if (!new_style_driver) return -1; =20 @@ -67,7 +67,7 @@ diff -Naur pppd.orig/sys-linux.c pppd/sys-linux.c if (master_fd < 0) fatal("Couldn't open /dev/ppp: %m"); if (ioctl(master_fd, PPPIOCATTACH, &ifnum) < 0) { -@@ -2533,7 +2533,7 @@ +@@ -2541,7 +2541,7 @@ if (tune_kernel) { forw_path =3D path_to_procfs("/sys/net/ipv4/ip_forward"); if (forw_path !=3D 0) { @@ -76,7 +76,7 @@ diff -Naur pppd.orig/sys-linux.c pppd/sys-linux.c if (fd >=3D 0) { if (write(fd, "1", 1) !=3D 1) error("Couldn't enable IP forwarding: %m"); -@@ -2878,7 +2878,7 @@ +@@ -2886,7 +2886,7 @@ sscanf(utsname.release, "%d.%d.%d", &osmaj, &osmin, &ospatch); kernel_version =3D KVERSION(osmaj, osmin, ospatch); =20 @@ -85,7 +85,7 @@ diff -Naur pppd.orig/sys-linux.c pppd/sys-linux.c if (fd >=3D 0) { new_style_driver =3D 1; =20 -@@ -3056,7 +3056,7 @@ +@@ -3064,7 +3064,7 @@ #if __GLIBC__ >=3D 2 updwtmp(_PATH_WTMP, &ut); #else @@ -94,7 +94,7 @@ diff -Naur pppd.orig/sys-linux.c pppd/sys-linux.c if (wtmp >=3D 0) { flock(wtmp, LOCK_EX); =20 -@@ -3280,7 +3280,7 @@ +@@ -3288,7 +3288,7 @@ int fd; =20 path =3D path_to_procfs("/sys/net/ipv4/ip_dynaddr"); @@ -103,7 +103,7 @@ diff -Naur pppd.orig/sys-linux.c pppd/sys-linux.c if (write(fd, "1", 1) !=3D 1) error("Couldn't enable dynamic IP addressing: %m"); close(fd); -@@ -3534,7 +3534,7 @@ +@@ -3542,7 +3542,7 @@ /* * Try the unix98 way first. */ @@ -112,7 +112,7 @@ diff -Naur pppd.orig/sys-linux.c pppd/sys-linux.c if (mfd >=3D 0) { int ptn; if (ioctl(mfd, TIOCGPTN, &ptn) >=3D 0) { -@@ -3545,7 +3545,8 @@ +@@ -3553,7 +3553,8 @@ if (ioctl(mfd, TIOCSPTLCK, &ptn) < 0) warn("Couldn't unlock pty slave %s: %m", pty_name); #endif @@ -122,7 +122,7 @@ diff -Naur pppd.orig/sys-linux.c pppd/sys-linux.c { warn("Couldn't open pty slave %s: %m", pty_name); close(mfd); -@@ -3559,10 +3560,10 @@ +@@ -3567,10 +3568,10 @@ for (i =3D 0; i < 64; ++i) { slprintf(pty_name, sizeof(pty_name), "/dev/pty%c%x", 'p' + i / 16, i % 16); @@ -135,19 +135,19 @@ diff -Naur pppd.orig/sys-linux.c pppd/sys-linux.c if (sfd >=3D 0) { ret =3D fchown(sfd, uid, -1); if (ret !=3D 0) { -diff -Naur pppd.orig/tdb.c pppd/tdb.c ---- pppd.orig/tdb.c 2021-07-23 06:41:07.000000000 +0200 -+++ pppd/tdb.c 2023-06-30 13:12:55.034900600 +0200 -@@ -1728,7 +1728,7 @@ - goto internal; +diff -Naur ppp-e1266c7-orig/pppd/tdb.c ppp-e1266c7/pppd/tdb.c +--- ppp-e1266c7-orig/pppd/tdb.c 2024-02-13 10:40:56.000000000 +0100 ++++ ppp-e1266c7/pppd/tdb.c 2024-03-15 10:51:25.182882191 +0100 +@@ -1732,7 +1732,7 @@ } =20 + again: - if ((tdb->fd =3D open(name, open_flags, mode)) =3D=3D -1) { + if ((tdb->fd =3D open(name, open_flags | O_CLOEXEC, mode)) =3D=3D -1) { - TDB_LOG((tdb, 5, "tdb_open_ex: could not open file %s: %s\n", - name, strerror(errno))); - goto fail; /* errno set by open(2) */ -@@ -1971,7 +1971,7 @@ + if ((open_flags & O_CREAT) && errno =3D=3D ENOENT && + mkdir_recursive(PPP_PATH_VARRUN) =3D=3D 0) + goto again; +@@ -1979,7 +1979,7 @@ } if (close(tdb->fd) !=3D 0) TDB_LOG((tdb, 0, "tdb_reopen: WARNING closing tdb->fd failed!\n")); @@ -156,9 +156,9 @@ diff -Naur pppd.orig/tdb.c pppd/tdb.c if (tdb->fd =3D=3D -1) { TDB_LOG((tdb, 0, "tdb_reopen: open failed (%s)\n", strerror(errno))); goto fail; -diff -Naur pppd.orig/tty.c pppd/tty.c ---- pppd.orig/tty.c 2023-03-25 05:38:30.000000000 +0100 -+++ pppd/tty.c 2023-06-30 13:14:06.450418113 +0200 +diff -Naur ppp-e1266c7-orig/pppd/tty.c ppp-e1266c7/pppd/tty.c +--- ppp-e1266c7-orig/pppd/tty.c 2024-02-13 10:40:56.000000000 +0100 ++++ ppp-e1266c7/pppd/tty.c 2024-03-15 10:52:35.828341901 +0100 @@ -621,7 +621,7 @@ ppp_set_status(EXIT_OPEN_FAILED); goto errret; @@ -177,10 +177,10 @@ diff -Naur pppd.orig/tty.c pppd/tty.c break; if (errno !=3D EINTR) { error("Failed to reopen %s: %m", devnam); -diff -Naur pppd.orig/utils.c pppd/utils.c ---- pppd.orig/utils.c 2022-12-30 02:12:39.000000000 +0100 -+++ pppd/utils.c 2023-06-30 13:15:47.860182369 +0200 -@@ -843,14 +843,14 @@ +diff -Naur ppp-e1266c7-orig/pppd/utils.c ppp-e1266c7/pppd/utils.c +--- ppp-e1266c7-orig/pppd/utils.c 2024-02-13 10:40:56.000000000 +0100 ++++ ppp-e1266c7/pppd/utils.c 2024-03-15 10:55:27.176832115 +0100 +@@ -926,14 +926,14 @@ slprintf(lock_file, sizeof(lock_file), "%s/LCK..%s", PPP_PATH_LOCKDIR, = dev); #endif =20 @@ -197,7 +197,7 @@ diff -Naur pppd.orig/utils.c pppd/utils.c if (fd < 0) { if (errno =3D=3D ENOENT) /* This is just a timing problem. */ continue; -@@ -933,7 +933,7 @@ +@@ -1016,7 +1016,7 @@ =20 if (lock_file[0] =3D=3D 0) return -1; --=20 2.44.0 --===============1057527150484415977==--