Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Ismael Luceno (3ed9ed811fc75327f6dc8e583af4b2d7180f73cb)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Ismael Luceno (3ed9ed811fc75327f6dc8e583af4b2d7180f73cb)
  • Date: Wed, 28 Aug 2019 18:21:03 +0000

GIT changes to master grimoire by Ismael Luceno <ismael AT sourcemage.org>:

net/ppp/BUILD | 5 +
net/ppp/DETAILS | 5 -
net/ppp/HISTORY | 13 +++
net/ppp/PRE_BUILD | 39 ++++++++--
net/ppp/l2tp.patch | 49 -------------
net/ppp/mppe-header.patch | 11 ---
net/ppp/patches/CVE-2015-3310.patch | 18 ++++
net/ppp/patches/mppe-header.patch | 11 +++
net/ppp/patches/netinet_in_h_fix.patch | 37 ++++++++++
net/ppp/patches/openssl_DES.patch | 121
+++++++++++++++++++++++++++++++++
net/ppp/patches/portability.patch | 45 ++++++++++++
11 files changed, 282 insertions(+), 72 deletions(-)

New commits:
commit 3ed9ed811fc75327f6dc8e583af4b2d7180f73cb
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

ppp: Fix build against musl

commit c5d0c7af796cb37d9920bb49cdb74a32b7f51152
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

ppp: Fix more header includes

commit a1dfa2bf55177690f633a1aa892211a1c8ace17f
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

ppp: Import general patches from Void-Linux

commit 80ba26cc74127eacac4cedd64afaa0c3ab5eb7e7
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

ppp: Move mppe-header.patch into a patches folder

commit a36c86cc19149c2040f498ac11d268529f411d9f
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

ppp: Add LDFLAGS to COPTS

commit 36491eeaa9f6e0a073afefb7844d6c866e7f7603
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

ppp: Make the buildsystem respect system build flags

commit 607fa8b3a0844c08121531ea73982a62c15fe6d1
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

ppp 2.4.7

diff --git a/net/ppp/BUILD b/net/ppp/BUILD
index a5db5a4..0a9e991 100755
--- a/net/ppp/BUILD
+++ b/net/ppp/BUILD
@@ -3,4 +3,7 @@ create_group ppp &&
./configure --prefix="$INSTALL_ROOT/usr" \
--sysconfdir="$INSTALL_ROOT/etc" &&

-make COPTS="$CFLAGS"
+case "$HOST" in
+*-musl) CFLAGS+=' -D"__P(x)=x"' ;;
+esac &&
+make COPTS="$CFLAGS $LDFLAGS"
diff --git a/net/ppp/DETAILS b/net/ppp/DETAILS
index bfa2906..955e059 100755
--- a/net/ppp/DETAILS
+++ b/net/ppp/DETAILS
@@ -1,11 +1,10 @@
SPELL=ppp
- VERSION=2.4.5
+ VERSION=2.4.7
SECURITY_PATCH=1
- PATCHLEVEL=1
SOURCE=$SPELL-$VERSION.tar.gz
SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELL-$VERSION"
SOURCE_URL[0]=https://download.samba.org/pub/ppp/$SOURCE
-
SOURCE_HASH=sha512:3688720a0f9ee47802e72dc6aa3d47c7312c195007f37a6ceb087fdb6f1f77ad75e922a568cffed6d1a857f06d79460d6d38b56e179310e493a0380a0c5a4f6e
+
SOURCE_HASH=sha512:e34ce24020af6a73e7a26c83c4f73a9c83fa455b7b363794dba27bf01f70368be06bff779777843949bd77f4bc9385d6ad455ea48bf8fff4e0d73cc8fef16ae2
LICENSE[0]=http://va.samba.org/ppp/README.html
WEB_SITE=http://www.samba.org/ppp/
ENTERED=20010922
diff --git a/net/ppp/HISTORY b/net/ppp/HISTORY
index 7926e1c..0535d39 100644
--- a/net/ppp/HISTORY
+++ b/net/ppp/HISTORY
@@ -1,3 +1,15 @@
+2019-05-28 Ismael Luceno <ismael AT sourcemage.org>
+ * DETAILS, PRE_BUILD: updated spell to 2.4.7
+ * l2tp.patch: removed, not needed anymore
+ * PRE_BUILD: Made the build system respect build flags
+ * BUILD: Added LDFLAGS to COPTS
+ * PRE_BUILD, mppe-header.patch: Move patch to a patches folder
+ * patches/CVE-2015-3310.patch, patches/netinet_in_h_fix.patch,
+ patches/openssl_DES.patch, patches/openssl_include.patch:
+ Imported general patches from Void-Linux
+ * PRE_BUILD: Fixed more header includes
+ * BUILD, PRE_BUILD, patches/portability.patch: Fixed build against
musl
+
2017-01-13 David C. Haley <khoralin AT gmail.com>
* DETAILS: updated SOURCE_URL

@@ -144,4 +156,3 @@
* DETAILS: added LICENSE
thanks to Justin Smithies <justin AT smithies.plus.com> for
help /w bugfix #350
-
diff --git a/net/ppp/PRE_BUILD b/net/ppp/PRE_BUILD
index 0894b0b..3ffd6cc 100755
--- a/net/ppp/PRE_BUILD
+++ b/net/ppp/PRE_BUILD
@@ -1,14 +1,31 @@
default_pre_build &&
cd "$SOURCE_DIRECTORY" &&
+apply_patch_dir patches &&

-# include mppe.h into build
-patch -p0 < "$SPELL_DIRECTORY/mppe-header.patch" &&
+# Respect custom build flags
+find -name Makefile.linux -exec \
+ sed -i -e '/FLAGS[\t ]*=/s/=/+=/' {} + &&

-# fixes use of >3.5 headers
-patch -p1 < "$SPELL_DIRECTORY/l2tp.patch" &&
+sed -i -e '/(CC) -o [^.]* /s/ -o / $(LDFLAGS)&/' \
+ chat/Makefile.linux \
+ pppd/plugins/rp-pppoe/Makefile.linux \
+ pppdump/Makefile.linux &&
+
+# Fix includes
+sed -i '/^#include/ {
+ s!<net/bpf!<pcap-bpf!
+ s!<sys/errno!<errno!
+ s!<linux/route!<net/route!
+}' \
+ pppd/demand.c \
+ pppd/sys-linux.c \
+ modules/if_ppp.c \
+ modules/ppp.c \
+ modules/ppp_ahdlc.c \
+ modules/ppp_comp.c \
+ pppd/sys-linux.c \
+&&

-sedit 's:net/bpf.h:pcap-bpf.h:' pppd/demand.c &&
-sedit 's:net/bpf.h:pcap-bpf.h:' pppd/sys-linux.c &&
sedit 's:/usr/man:/usr/share/man:' linux/Makefile.top &&

if is_depends_enabled $SPELL linux-pam; then
@@ -25,4 +42,12 @@ fi &&

if [ "$HAVE_CBCP" == "y" ]; then
sedit 's:#CBCP=y:CBCP=y:' pppd/Makefile.linux
-fi
+fi &&
+
+case "$HOST" in
+*-musl)
+ sedit '/^CFLAGS[\t +=]*-DHAVE_LOGWTMP=1/d' pppd/Makefile.linux &&
+ sedit '/^#define HAVE_\(NET_ETHERNET\|SYS_CDEFS\)_H 1/d' \
+ pppd/plugins/rp-pppoe/config.h
+ ;;
+esac
diff --git a/net/ppp/l2tp.patch b/net/ppp/l2tp.patch
deleted file mode 100644
index e99d479..0000000
--- a/net/ppp/l2tp.patch
+++ /dev/null
@@ -1,49 +0,0 @@
---- ppp-2.4.5/include/linux/if_pppol2tp.h 2009-11-16
22:26:07.000000000 +0000
-+++ ppp-2.4.5/include/linux/if_pppol2tp.h 2010-07-16
22:35:22.000000000 +0100
-@@ -32,6 +32,45 @@
- __u16 d_tunnel, d_session; /* For sending outgoing packets */
- };
-
-+/* Structure used to connect() the socket to a particular tunnel UDP
-+ * * socket over IPv6.
-+ * */
-+struct pppol2tpin6_addr {
-+ __kernel_pid_t pid; /* pid that owns the fd.
-+ * 0 => current */
-+ int fd; /* FD of UDP socket to use */
-+
-+ __u16 s_tunnel, s_session; /* For matching incoming packets */
-+ __u16 d_tunnel, d_session; /* For sending outgoing packets */
-+
-+ struct sockaddr_in6 addr; /* IP address and port to send to */
-+};
-+
-+/* The L2TPv3 protocol changes tunnel and session ids from 16 to 32
-+ * bits. So we need a different sockaddr structure.
-+ */
-+struct pppol2tpv3_addr {
-+ pid_t pid; /* pid that owns the fd.
-+ * 0 => current */
-+ int fd; /* FD of UDP or IP socket to use */
-+
-+ struct sockaddr_in addr; /* IP address and port to send to */
-+
-+ __u32 s_tunnel, s_session; /* For matching incoming packets */
-+ __u32 d_tunnel, d_session; /* For sending outgoing packets */
-+};
-+
-+struct pppol2tpv3in6_addr {
-+ __kernel_pid_t pid; /* pid that owns the fd.
-+ * 0 => current */
-+ int fd; /* FD of UDP or IP socket to use */
-+
-+ __u32 s_tunnel, s_session; /* For matching incoming packets */
-+ __u32 d_tunnel, d_session; /* For sending outgoing packets */
-+
-+ struct sockaddr_in6 addr; /* IP address and port to send to */
-+};
-+
- /* Socket options:
- * DEBUG - bitmask of debug message categories
- * SENDSEQ - 0 => don't send packets with sequence numbers
-
diff --git a/net/ppp/mppe-header.patch b/net/ppp/mppe-header.patch
deleted file mode 100644
index 4124e3a..0000000
--- a/net/ppp/mppe-header.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- pppd/Makefile.linux.orig 2009-11-17 01:26:07.000000000 +0300
-+++ pppd/Makefile.linux 2013-05-21 01:50:23.063838264 +0400
-@@ -16,7 +16,7 @@
- demand.c utils.c tty.c eap.c chap-md5.c session.c
-
- HEADERS = ccp.h session.h chap-new.h ecp.h fsm.h ipcp.h \
-- ipxcp.h lcp.h magic.h md5.h patchlevel.h pathnames.h pppd.h \
-+ ipxcp.h lcp.h magic.h md5.h mppe.h patchlevel.h pathnames.h pppd.h \
- upap.h eap.h
-
- MANPAGES = pppd.8
diff --git a/net/ppp/patches/CVE-2015-3310.patch
b/net/ppp/patches/CVE-2015-3310.patch
new file mode 100644
index 0000000..2f5d57c
--- /dev/null
+++ b/net/ppp/patches/CVE-2015-3310.patch
@@ -0,0 +1,18 @@
+Fix buffer overflow in rc_mksid()
+
+rc_mksid converts the PID of pppd to hex to generate a pseudo-unique string.
+If the process id is bigger than 65535 (FFFF), its hex representation will be
+longer than 4 characters, resulting in a buffer overflow.
+
+The bug can be exploited to cause a remote DoS.
+--- a/pppd/plugins/radius/util.c
++++ b/pppd/plugins/radius/util.c
+@@ -77,7 +77,7 @@ rc_mksid (void)
+ static unsigned short int cnt = 0;
+ sprintf (buf, "%08lX%04X%02hX",
+ (unsigned long int) time (NULL),
+- (unsigned int) getpid (),
++ (unsigned int) getpid () & 0xFFFF,
+ cnt & 0xFF);
+ cnt++;
+ return buf;
diff --git a/net/ppp/patches/mppe-header.patch
b/net/ppp/patches/mppe-header.patch
new file mode 100644
index 0000000..3eb9c5a
--- /dev/null
+++ b/net/ppp/patches/mppe-header.patch
@@ -0,0 +1,11 @@
+--- a/pppd/Makefile.linux
++++ b/pppd/Makefile.linux
+@@ -16,7 +16,7 @@
+ demand.c utils.c tty.c eap.c chap-md5.c session.c
+
+ HEADERS = ccp.h session.h chap-new.h ecp.h fsm.h ipcp.h \
+- ipxcp.h lcp.h magic.h md5.h patchlevel.h pathnames.h pppd.h \
++ ipxcp.h lcp.h magic.h md5.h mppe.h patchlevel.h pathnames.h pppd.h \
+ upap.h eap.h
+
+ MANPAGES = pppd.8
diff --git a/net/ppp/patches/netinet_in_h_fix.patch
b/net/ppp/patches/netinet_in_h_fix.patch
new file mode 100644
index 0000000..000613d
--- /dev/null
+++ b/net/ppp/patches/netinet_in_h_fix.patch
@@ -0,0 +1,37 @@
+From 50a2997b256e0e0ef7a46fae133f56f60fce539c Mon Sep 17 00:00:00 2001
+From: Lubomir Rintel <lkundrak AT v3.sk>
+Date: Mon, 9 Jan 2017 13:34:23 +0000
+Subject: [PATCH] pppoe: include netinet/in.h before linux/in.h
+
+This fixes builds with newer kernels. Basically, <netinet/in.h> needs to be
+included before <linux/in.h> otherwise the earlier, unaware of the latter,
+tries to redefine symbols and structures. Also, <linux/if_pppox.h> doesn't
work
+alone anymore, since it pulls the headers in the wrong order, so we better
+include <netinet/in.h> early.
+---
+ pppd/plugins/rp-pppoe/pppoe.h | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/pppd/plugins/rp-pppoe/pppoe.h b/pppd/plugins/rp-pppoe/pppoe.h
+index 9ab2eee3..c4aaa6e6 100644
+--- a/pppd/plugins/rp-pppoe/pppoe.h
++++ b/pppd/plugins/rp-pppoe/pppoe.h
+@@ -47,6 +47,10 @@
+ #include <sys/socket.h>
+ #endif
+
++/* This has to be included before Linux 4.8's linux/in.h
++ * gets dragged in. */
++#include <netinet/in.h>
++
+ /* Ugly header files on some Linux boxes... */
+ #if defined(HAVE_LINUX_IF_H)
+ #include <linux/if.h>
+@@ -84,8 +88,6 @@ typedef unsigned long UINT32_t;
+ #include <linux/if_ether.h>
+ #endif
+
+-#include <netinet/in.h>
+-
+ #ifdef HAVE_NETINET_IF_ETHER_H
+ #include <sys/types.h>
diff --git a/net/ppp/patches/openssl_DES.patch
b/net/ppp/patches/openssl_DES.patch
new file mode 100644
index 0000000..28fd482
--- /dev/null
+++ b/net/ppp/patches/openssl_DES.patch
@@ -0,0 +1,121 @@
+From 3c7b86229f7bd2600d74db14b1fe5b3896be3875 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= <jskarvad AT redhat.com>
+Date: Fri, 6 Apr 2018 14:27:18 +0200
+Subject: [PATCH] pppd: Use openssl for the DES instead of the libcrypt /
glibc
+
+It seems the latest glibc (in Fedora glibc-2.27.9000-12.fc29) dropped
+libcrypt. The libxcrypt standalone package can be used instead, but
+it dropped the old setkey/encrypt API which ppp uses for DES. There
+is support for using openssl in pppcrypt.c, but it contains typos
+preventing it from compiling and seems to be written for an ancient
+openssl version.
+
+This updates the code to use current openssl.
+
+[paulus AT ozlabs.org - wrote the commit description, fixed comment in
+ Makefile.linux.]
+[ismael AT sourcemage.org: Merged openssl include fix]
+
+Signed-off-by: Jaroslav Škarvada <jskarvad AT redhat.com>
+Signed-off-by: Paul Mackerras <paulus AT ozlabs.org>
+Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
+---
+ pppd/Makefile.linux | 6 +++---
+ pppd/pppcrypt.c | 18 +++++++++---------
+ pppd/pppcrypt.h | 2 +-
+ 3 files changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/pppd/Makefile.linux b/pppd/Makefile.linux
+index 36d2b036..8d5ce99d 100644
+--- a/pppd/Makefile.linux
++++ b/pppd/Makefile.linux
+@@ -35,10 +35,10 @@ endif
+ COPTS = -O2 -pipe -Wall -g
+ LIBS =
+
+-# Uncomment the next 2 lines to include support for Microsoft's
++# Uncomment the next line to include support for Microsoft's
+ # MS-CHAP authentication protocol. Also, edit
plugins/radius/Makefile.linux.
+ CHAPMS=y
+-USE_CRYPT=y
++#USE_CRYPT=y
+ # Don't use MSLANMAN unless you really know what you're doing.
+ #MSLANMAN=y
+ # Uncomment the next line to include support for MPPE. CHAPMS (above) must
+@@ -132,7 +132,7 @@ endif
+
+ ifdef NEEDDES
+ ifndef USE_CRYPT
+-LIBS += -ldes $(LIBS)
++LIBS += -lcrypto
+ else
+ CFLAGS += -DUSE_CRYPT=1
+ endif
+diff --git a/pppd/pppcrypt.c b/pppd/pppcrypt.c
+index 8b85b132..6b35375e 100644
+--- a/pppd/pppcrypt.c
++++ b/pppd/pppcrypt.c
+@@ -64,7 +64,7 @@ u_char *des_key; /* OUT 64 bit DES key with parity
bits added */
+ des_key[7] = Get7Bits(key, 49);
+
+ #ifndef USE_CRYPT
+- des_set_odd_parity((des_cblock *)des_key);
++ DES_set_odd_parity((DES_cblock *)des_key);
+ #endif
+ }
+
+@@ -158,25 +158,25 @@ u_char *clear; /* OUT 8 octets */
+ }
+
+ #else /* USE_CRYPT */
+-static des_key_schedule key_schedule;
++static DES_key_schedule key_schedule;
+
+ bool
+ DesSetkey(key)
+ u_char *key;
+ {
+- des_cblock des_key;
++ DES_cblock des_key;
+ MakeKey(key, des_key);
+- des_set_key(&des_key, key_schedule);
++ DES_set_key(&des_key, &key_schedule);
+ return (1);
+ }
+
+ bool
+-DesEncrypt(clear, key, cipher)
++DesEncrypt(clear, cipher)
+ u_char *clear; /* IN 8 octets */
+ u_char *cipher; /* OUT 8 octets */
+ {
+- des_ecb_encrypt((des_cblock *)clear, (des_cblock *)cipher,
+- key_schedule, 1);
++ DES_ecb_encrypt((DES_cblock *)clear, (DES_cblock *)cipher,
++ &key_schedule, 1);
+ return (1);
+ }
+
+@@ -185,8 +185,8 @@ DesDecrypt(cipher, clear)
+ u_char *cipher; /* IN 8 octets */
+ u_char *clear; /* OUT 8 octets */
+ {
+- des_ecb_encrypt((des_cblock *)cipher, (des_cblock *)clear,
+- key_schedule, 0);
++ DES_ecb_encrypt((DES_cblock *)cipher, (DES_cblock *)clear,
++ &key_schedule, 0);
+ return (1);
+ }
+
+diff --git a/pppd/pppcrypt.h b/pppd/pppcrypt.h
+--- a/pppd/pppcrypt.h
++++ b/pppd/pppcrypt.h
+@@ -38,7 +38,7 @@
+ #endif
+
+ #ifndef USE_CRYPT
+-#include <des.h>
++#include <openssl/des.h>
+ #endif
+
+ extern bool DesSetkey __P((u_char *));
diff --git a/net/ppp/patches/portability.patch
b/net/ppp/patches/portability.patch
new file mode 100644
index 0000000..ad19c7d
--- /dev/null
+++ b/net/ppp/patches/portability.patch
@@ -0,0 +1,45 @@
+From: Ismael Luceno <ismael AT sourcemage.org>
+Subject: [PATCH] Fix portability issues
+
+Enables building against musl libc.
+
+---
+ include/net/ppp_defs.h | 2 ++
+ pppd/plugins/rp-pppoe/plugin.c | 2 ++
+ pppd/plugins/rp-pppoe/pppoe.h | 2 +-
+ 3 files changed, 5 insertions(+), 1 deletion(-)
+
+--- a/include/net/ppp_defs.h
++++ b/include/net/ppp_defs.h
+@@ -38,6 +38,8 @@
+ #ifndef _PPP_DEFS_H_
+ #define _PPP_DEFS_H_
+
++#include <sys/time.h>
++
+ /*
+ * The basic PPP frame.
+ */
+--- a/pppd/plugins/rp-pppoe/pppoe.h
++++ b/pppd/plugins/rp-pppoe/pppoe.h
+@@ -92,7 +92,7 @@ typedef unsigned long UINT32_t;
+ #ifdef HAVE_SYS_SOCKET_H
+ #include <sys/socket.h>
+ #endif
+-#ifndef HAVE_SYS_DLPI_H
++#if !defined HAVE_SYS_DLPI_H && defined HAVE_NET_ETHERNET_H
+ #include <netinet/if_ether.h>
+ #endif
+ #endif
+--- a/pppd/plugins/rp-pppoe/plugin.c
++++ b/pppd/plugins/rp-pppoe/plugin.c
+@@ -46,7 +46,9 @@ static char const RCSID[] =
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <signal.h>
++#ifdef HAVE_NET_ETHERNET_H
+ #include <net/ethernet.h>
++#endif
+ #include <net/if_arp.h>
+ #include <linux/ppp_defs.h>
+ #include <linux/if_pppox.h>



  • [SM-Commit] GIT changes to master grimoire by Ismael Luceno (3ed9ed811fc75327f6dc8e583af4b2d7180f73cb), Ismael Luceno, 08/28/2019

Archive powered by MHonArc 2.6.24.

Top of Page