Skip to content

Commit

Permalink
main/ppp: revert lock dir to /var/lock
Browse files Browse the repository at this point in the history
Backport upstream fix for pppd failing to start when lock dir
does not exist (by reverting the lock dir to somewhere that
should always exist)

This fixes using pppd from something else than the main pppd service
(e.g. networkmanager of ifupdown-ng), as these would not go through the
checkpath hook, and pppd can now run without /run/ppp

(cherry picked from commit 4a61d71)

Link: ppp-project/ppp#435
Fixes: #15145
  • Loading branch information
martinetd committed Oct 10, 2023
1 parent 31d3b15 commit 35d0cb3
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 3 deletions.
61 changes: 61 additions & 0 deletions main/ppp/0001-Revert-lock-path-to-var-lock-435.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
From 99cbf5e269994482edaf64624be8b1c806f9587c Mon Sep 17 00:00:00 2001
From: Dominique Martinet <[email protected]>
Date: Tue, 10 Oct 2023 10:05:50 +0900
Subject: [PATCH] Revert lock path to /var/lock (#435)

lock dir changed on linux from /var/lock to /run/pppd/lock with
pppd-2.5.0, which makes pppd fail to start if the distribution does not
pre-create the directory.

This reverts it back to /var/lock.

The paths for other OS should be identical as LOCALSTATEDIR should be
/var, but also revert them back as well just in case.
Since the variable is no longer used remove it from makefiles.

Fixes: 66a8c74c3f73 ("Let ./configure control the paths for pppd")
Fixes: #419

Signed-off-by: Dominique Martinet <[email protected]>
Co-authored-by: Dominique Martinet <[email protected]>
---
pppd/Makefile.am | 2 +-
pppd/pathnames.h | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pppd/Makefile.am b/pppd/Makefile.am
index e5bedf26af96..7cb30053322e 100644
--- a/pppd/Makefile.am
+++ b/pppd/Makefile.am
@@ -83,7 +83,7 @@ pppd_SOURCES = \
upap.c \
utils.c

-pppd_CPPFLAGS = -DSYSCONFDIR=\"${sysconfdir}\" -DLOCALSTATEDIR=\"${localstatedir}\" -DPPPD_RUNTIME_DIR='"@PPPD_RUNTIME_DIR@"' -DPPPD_LOGFILE_DIR='"@PPPD_LOGFILE_DIR@"'
+pppd_CPPFLAGS = -DSYSCONFDIR=\"${sysconfdir}\" -DPPPD_RUNTIME_DIR='"@PPPD_RUNTIME_DIR@"' -DPPPD_LOGFILE_DIR='"@PPPD_LOGFILE_DIR@"'
pppd_LDFLAGS =
pppd_LIBS =

diff --git a/pppd/pathnames.h b/pppd/pathnames.h
index de2fb6889005..12609a969429 100644
--- a/pppd/pathnames.h
+++ b/pppd/pathnames.h
@@ -120,12 +120,12 @@
#define PPP_PATH_PPPDB PPP_PATH_VARRUN "/pppd2.tdb"

#ifdef __linux__
-#define PPP_PATH_LOCKDIR PPP_PATH_VARRUN "/lock"
+#define PPP_PATH_LOCKDIR "/var/lock"
#else
#ifdef SVR4
-#define PPP_PATH_LOCKDIR LOCALSTATEDIR "/spool/locks"
+#define PPP_PATH_LOCKDIR "/var/spool/locks"
#else
-#define PPP_PATH_LOCKDIR LOCALSTATEDIR "/spool/lock"
+#define PPP_PATH_LOCKDIR "/var/spool/lock"
#endif
#endif

--
2.39.2

6 changes: 4 additions & 2 deletions main/ppp/APKBUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <[email protected]>
pkgname=ppp
pkgver=2.5.0
pkgrel=3
pkgrel=4
pkgdesc="A daemon which implements the PPP protocol for dial-up networking"
url="https://ppp.samba.org/"
arch="all"
Expand Down Expand Up @@ -48,6 +48,7 @@ source="https://github.com/paulusmack/ppp/archive/ppp-$pkgver.tar.gz
0011-build-sys-don-t-put-connect-errors-log-to-etc-ppp.patch
fix-paths.patch
musl-fix-headers.patch
0001-Revert-lock-path-to-var-lock-435.patch
ip-down
ip-up
pppd.initd
Expand Down Expand Up @@ -202,7 +203,8 @@ cf62410a952053f9aa71c5179453831152e958fcad9e77df2ddac864e39aa71af0b746e54b91e8fa
1e1962503ea7639b2683920c73a848d680d1daf444fb978a42639f1671b2c38282d181be120fbf035220bcfe8768229897b7e5a59e6ddf09d4edb3666ebf3399 0011-build-sys-don-t-put-connect-errors-log-to-etc-ppp.patch
f8ad85423ccf19a6cea66e9debea81dc1842bf499b279b77c058cc2ff10aae7f48c3430a63050b97c4f535f5dcca449261fc7476f90cb2d30dfca9359490d6bd fix-paths.patch
8efb0750fb64cc6cbb3e5fce4a79e842db3c7fd08c3c1899cda4201a80f9ec7a4c88d88be833579b9470c1d851f01fbf2cd82b51912ebc4f05bbb168f6e73bc3 musl-fix-headers.patch
218f5ae25f059f4ab614d6c613f8317dd136a59378f31e3b7c868f79869a17a79f1d88bf226828e7a21db07337f5c2328ce3f4579d747b9bfe1082b1023193f0 0001-Revert-lock-path-to-var-lock-435.patch
160260bd2a788beaac395eadb38efbfd1e0e1a458fe151555acacf2c4f3a12381d644672c664f9793db6e3459a4f05a54e3ff6d407b0d37e8014b15bd0f11bcc ip-down
8258c95a6b6e8e94d6001b5cd3a99bd3270f29ba0f2e5050a26c8d5f1b67eead8d039e71ce86a784d45e620047b0a2bb14b258d80a9ea62084ba588a4c2e2d84 ip-up
3b24d78ef2f94fdeda8e3870d774ed293e4ac8a54a7c08b6b1231f82894c1f46607009d807293bd5b4899013eafafeaa9760e2ecaeef403dd0819dd6cc2d75b9 pppd.initd
845d99cefd9e3ebfd4ff61dbf86d5bc1a698abbf204fed5a577fbc873e378c6d5d35712331b97dfd9fa37d1f7157a034f2584521f3a28ec18b883ab8d420e028 pppd.initd
"
2 changes: 1 addition & 1 deletion main/ppp/pppd.initd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pidfile="/run/$RC_SVCNAME.pid"
command_background=true

start_pre() {
checkpath --directory /run/ppp/lock
checkpath --directory /run/ppp
modprobe pptp
}

0 comments on commit 35d0cb3

Please sign in to comment.