Source: pptpd
Version: 1.4.0-12
Severity: important
Tags: patch

Hi Christoph,

I'm preparing to upload ppp-2.5.0 to unstable, and pptpd fails to build
with the updated pppd plugin API in ppp-2.5.0. I've prepared a patch for
pptpd which fixes the problem; I have build-tested this but not runtime
tested.

Please could you try the patch and test the pptpd-logwtmp.so pppd
plugin, and upload the package to unstable?

I'll upgrade the bug to RC when I upload ppp-2.5.0 to unstable. I can
also NMU if you would like me to.

Many thanks,
Chris

-- 
diff --git a/debian/changelog b/debian/changelog
index 3e5aae3f64ab..164fdbc6c664 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+pptpd (1.4.0-13) UNRELEASED; urgency=medium
+
+  * Fix build failures with ppp 2.5.0. (Closes: XXXXXXX)
+
+ -- Chris Boot <bo...@debian.org>  Sun, 26 Nov 2023 10:48:24 +0000
+
 pptpd (1.4.0-12) unstable; urgency=medium
 
   * Packaging cleanup
diff --git a/debian/control b/debian/control
index c81c783cf42d..04fc6d23fb55 100644
--- a/debian/control
+++ b/debian/control
@@ -5,8 +5,9 @@ Standards-Version: 4.5.1
 Vcs-Browser: https://git.in-ulm.de/cbiedl/pptpd
 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
diff --git a/debian/patches/local.ppp-2.5.patch 
b/debian/patches/local.ppp-2.5.patch
new file mode 100644
index 000000000000..6f9be9ad20d9
--- /dev/null
+++ b/debian/patches/local.ppp-2.5.patch
@@ -0,0 +1,66 @@
+Subject: Build fixes for ppp-2.5
+Author: Chris Boot <bo...@debian.org>
+Last-Update: 2023-11-26
+
+--- 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$");
+ }
diff --git a/debian/patches/series b/debian/patches/series
index 105d7f3903e3..d7cf62738b62 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -11,3 +11,4 @@ local.build_hardening-flags.patch
 local.build_plugin.patch
 local.fix-typos.patch
 local.install-nonroot.patch
+local.ppp-2.5.patch
diff --git a/debian/rules b/debian/rules
index c442aa544882..ced3421adef8 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,7 +3,7 @@
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
 %:
-       dh $@ --with ppp
+       dh $@
 
 override_dh_auto_configure:
        dh_auto_configure -- \

Reply via email to