summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2023-04-28 16:50:35 -0400
committerMike Gilbert <floppym@gentoo.org>2023-04-28 16:50:35 -0400
commitba13e6934df6244c76a02674ae55c81af2716c5d (patch)
tree088d9254be09f335b7e586ca017077610af2c964 /net-vpn
parentnet-vpn/pptpd: restrict net-vpn/ppp dependency (diff)
downloadgentoo-ba13e6934df6244c76a02674ae55c81af2716c5d.tar.gz
gentoo-ba13e6934df6244c76a02674ae55c81af2716c5d.tar.bz2
gentoo-ba13e6934df6244c76a02674ae55c81af2716c5d.zip
net-vpn/pptpd: fix build with ppp-2.5.0
Closes: https://bugs.gentoo.org/904877 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
Diffstat (limited to 'net-vpn')
-rw-r--r--net-vpn/pptpd/files/pptpd-1.4.0-ppp-2.5.0.patch83
-rw-r--r--net-vpn/pptpd/pptpd-1.4.0-r3.ebuild29
2 files changed, 97 insertions, 15 deletions
diff --git a/net-vpn/pptpd/files/pptpd-1.4.0-ppp-2.5.0.patch b/net-vpn/pptpd/files/pptpd-1.4.0-ppp-2.5.0.patch
new file mode 100644
index 000000000000..b3525052a873
--- /dev/null
+++ b/net-vpn/pptpd/files/pptpd-1.4.0-ppp-2.5.0.patch
@@ -0,0 +1,83 @@
+https://bugs.gentoo.org/904877
+
+From ea207b89c61e3a201155b973307ee45413f0d058 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Fri, 28 Apr 2023 16:37:44 -0400
+Subject: [PATCH] pptp-logwtmp: update for ppp-2.5.0
+
+Signed-off-by: Mike Gilbert <floppym@gentoo.org>
+---
+ plugins/pptpd-logwtmp.c | 25 +++++++++++++++----------
+ 1 file changed, 15 insertions(+), 10 deletions(-)
+
+diff --git a/plugins/pptpd-logwtmp.c b/plugins/pptpd-logwtmp.c
+index ac5ecc2..457bbce 100644
+--- a/plugins/pptpd-logwtmp.c
++++ b/plugins/pptpd-logwtmp.c
+@@ -12,14 +12,16 @@
+ #include <unistd.h>
+ #include <utmp.h>
+ #include <string.h>
++#include <limits.h>
+ #include <pppd/pppd.h>
++#include <pppd/options.h>
+
+-char pppd_version[] = VERSION;
++char pppd_version[] = PPPD_VERSION;
+
+ static char pptpd_original_ip[PATH_MAX+1];
+ static bool pptpd_logwtmp_strip_domain = 0;
+
+-static option_t options[] = {
++static struct option options[] = {
+ { "pptpd-original-ip", o_string, pptpd_original_ip,
+ "Original IP address of the PPTP connection",
+ OPT_STATIC, NULL, PATH_MAX },
+@@ -28,7 +30,7 @@ static option_t options[] = {
+ { NULL }
+ };
+
+-static char *reduce(char *user)
++static const char *reduce(const char *user)
+ {
+ char *sep;
+ if (!pptpd_logwtmp_strip_domain) return user;
+@@ -42,8 +44,10 @@ static char *reduce(char *user)
+
+ static void ip_up(void *opaque, int arg)
+ {
+- char *user = reduce(peer_authname);
+- if (debug)
++ const char *peer_authname = ppp_peer_authname(NULL, 0);
++ const char *user = reduce(peer_authname);
++ const char *ifname = ppp_ifname();
++ if (debug_on())
+ notice("pptpd-logwtmp.so ip-up %s %s %s", ifname, user,
+ pptpd_original_ip);
+ logwtmp(ifname, user, pptpd_original_ip);
+@@ -51,16 +55,17 @@ static void ip_up(void *opaque, int arg)
+
+ static void ip_down(void *opaque, int arg)
+ {
+- if (debug)
++ const char *ifname = ppp_ifname();
++ if (debug_on())
+ notice("pptpd-logwtmp.so ip-down %s", ifname);
+ logwtmp(ifname, "", "");
+ }
+
+ void plugin_init(void)
+ {
+- add_options(options);
+- add_notifier(&ip_up_notifier, ip_up, NULL);
+- add_notifier(&ip_down_notifier, ip_down, NULL);
+- if (debug)
++ ppp_add_options(options);
++ ppp_add_notify(NF_IP_UP, ip_up, NULL);
++ ppp_add_notify(NF_IP_DOWN, ip_down, NULL);
++ if (debug_on())
+ notice("pptpd-logwtmp: $Version$");
+ }
+--
+2.40.1
+
diff --git a/net-vpn/pptpd/pptpd-1.4.0-r3.ebuild b/net-vpn/pptpd/pptpd-1.4.0-r3.ebuild
index 227b7be9450d..3a013c769e13 100644
--- a/net-vpn/pptpd/pptpd-1.4.0-r3.ebuild
+++ b/net-vpn/pptpd/pptpd-1.4.0-r3.ebuild
@@ -14,28 +14,14 @@ LICENSE="GPL-2"
KEYWORDS="amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc x86"
IUSE="gre-extreme-debug tcpd"
-RDEPEND="<net-dialup/ppp-2.5.0:=
+RDEPEND="net-dialup/ppp:=
tcpd? ( sys-apps/tcp-wrappers )"
DEPEND="${RDEPEND}
elibc_musl? ( net-libs/ppp-defs )"
DOCS=( AUTHORS ChangeLog NEWS README TODO )
-PATCHES=(
- "${FILESDIR}/${P}-gentoo.patch"
- "${FILESDIR}/${P}-sandbox-fix.patch"
- "${FILESDIR}/${P}-pidfile.patch"
- "${FILESDIR}/${P}-libdir.patch"
- "${FILESDIR}/${P}-musl.patch"
-)
-
src_prepare() {
- # Match pptpd-logwtmp.so's version with pppd's version (#89895)
- local PPPD_VER=$(best_version net-dialup/ppp)
- PPPD_VER=${PPPD_VER#*/*-} #reduce it to ${PV}-${PR}
- PPPD_VER=${PPPD_VER%%[_-]*} # main version without beta/pre/patch/revision
- sed -i -e "s:\\(#define[ \\t]*VERSION[ \\t]*\\)\".*\":\\1\"${PPPD_VER}\":" plugins/patchlevel.h || die
-
# configure.in is actually configure.ac
mv configure.in configure.ac || die
@@ -48,6 +34,19 @@ src_prepare() {
# respect compiler, bug #461722
tc-export CC
+ local PATCHES=(
+ "${FILESDIR}/${P}-gentoo.patch"
+ "${FILESDIR}/${P}-sandbox-fix.patch"
+ "${FILESDIR}/${P}-pidfile.patch"
+ "${FILESDIR}/${P}-libdir.patch"
+ "${FILESDIR}/${P}-musl.patch"
+ )
+
+ if has_version -d ">=net-dialup/ppp-2.5.0"; then
+ # https://bugs.gentoo.org/904877
+ PATCHES+=( "${FILESDIR}/${P}-ppp-2.5.0.patch" )
+ fi
+
# Call to default src_prepare to apply patches
default