ソースを参照

Adjust for pppd 2.5. Closes: #1056898

Christoph Biedl 5 ヶ月 前
コミット
a07a2897d8

+ 1 - 1
debian/control

@@ -7,7 +7,7 @@ Vcs-Git: https://git.in-ulm.de/cbiedl/pptpd.git
 Build-Depends: debhelper-compat (= 13),
     dh-sequence-ppp,
     libwrap0-dev,
-    ppp-dev (>= 2.4.7-1+~),
+    ppp-dev (>= 2.5.0-1+~),
 Priority: optional
 Rules-Requires-Root: no
 Section: net

+ 67 - 0
debian/patches/cherry-pick.1.4.0-22-gb77d92c.build-fixes-for-ppp-2-5.patch

@@ -0,0 +1,67 @@
+Subject: Build fixes for ppp-2.5
+Origin: 1.4.0-22-gb77d92c
+Upstream-Author: Chris Boot <bootc@debian.org>
+Date: Mon Nov 27 20:43:56 2023 +1100
+
+--- a/plugins/pptpd-logwtmp.c
++++ b/plugins/pptpd-logwtmp.c
+@@ -12,9 +12,12 @@
+ #include <unistd.h>
+ #include <utmp.h>
+ #include <string.h>
++#include <linux/if.h>
++#include <linux/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;
+@@ -28,7 +31,7 @@
+   { NULL }
+ };
+ 
+-static char *reduce(char *user)
++static const char *reduce(const char *user)
+ {
+   char *sep;
+   if (!pptpd_logwtmp_strip_domain) return user;
+@@ -42,8 +45,10 @@
+ 
+ static void ip_up(void *opaque, int arg)
+ {
+-  char *user = reduce(peer_authname);
+-  if (debug)
++  char ifname[IFNAMSIZ];
++  const char *user = reduce(ppp_peer_authname(NULL, 0));
++  ppp_get_ifname(ifname, sizeof(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 +56,18 @@
+ 
+ static void ip_down(void *opaque, int arg)
+ {
+-  if (debug) 
++  char ifname[IFNAMSIZ];
++  ppp_get_ifname(ifname, sizeof(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$");
+ }

+ 1 - 0
debian/patches/series

@@ -5,6 +5,7 @@ cherry-pick.1.4.0-14-gb84360b.pptpctrl-exit-when-bailing.patch
 cherry-pick.1.4.0-16-g0c0ad67.check-for-remote-ip-duplicates-in-pptpd-conf.patch
 cherry-pick.1.4.0-18-gd7b9552.fix-segfault-in-pptpctrl-argument-parser.patch
 cherry-pick.1.4.0-20-g4da603d.propagate-cc-to-subdirectories.patch
+cherry-pick.1.4.0-22-gb77d92c.build-fixes-for-ppp-2-5.patch
 
 # local modifications
 local.build_hardening-flags.patch