summaryrefslogtreecommitdiff
path: root/net-vpn/pptpd/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-04-28 23:13:34 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-04-28 23:13:34 +0100
commitb8395ecde09583851e86d0512adec19f7308d791 (patch)
tree80f0b26997037858eca514eecb197b37300ba4bb /net-vpn/pptpd/files
parent670fe3b64a21a723fda1e52fe61cad2327f81f67 (diff)
gentoo auto-resync : 28:04:2023 - 23:13:34
Diffstat (limited to 'net-vpn/pptpd/files')
-rw-r--r--net-vpn/pptpd/files/pptpd-1.4.0-ppp-2.5.0.patch83
1 files changed, 83 insertions, 0 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
+