ppp/ppp-pidfiles.patch
Reinhard Max a1bd3b005b - Backport ppp-pidfiles.patch and ppp-mkdir-run.patch from the
upcoming 2.5.1 release and make sure that pppd's pid, resolv
  and database files are created under /run/ppp (bsc#1218370).

OBS-URL: https://build.opensuse.org/package/show/network/ppp?expand=0&rev=80
2024-01-11 13:33:49 +00:00

35 lines
1.2 KiB
Diff

From 091e69b4e612427eeb95410dbc73eff10ea5dadb Mon Sep 17 00:00:00 2001
From: Mike Gilbert <floppym@gentoo.org>
Date: Mon, 26 Jun 2023 01:17:16 -0400
Subject: [PATCH] Ensure there is a '/' between PPP_PATH_VARRUN and the PID
filename (#427)
Bug: https://bugs.gentoo.org/907311
Fixes: 66a8c74c3f73 ("Let ./configure control the paths for pppd", 2022-07-30)
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
---
pppd/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- pppd/main.c.orig
+++ pppd/main.c
@@ -888,7 +888,7 @@ create_pidfile(int pid)
{
FILE *pidfile;
- slprintf(pidfilename, sizeof(pidfilename), "%s%s.pid",
+ slprintf(pidfilename, sizeof(pidfilename), "%s/%s.pid",
PPP_PATH_VARRUN, ifname);
if ((pidfile = fopen(pidfilename, "w")) != NULL) {
fprintf(pidfile, "%d\n", pid);
@@ -907,7 +907,7 @@ create_linkpidfile(int pid)
if (linkname[0] == 0)
return;
ppp_script_setenv("LINKNAME", linkname, 1);
- slprintf(linkpidfile, sizeof(linkpidfile), "%sppp-%s.pid",
+ slprintf(linkpidfile, sizeof(linkpidfile), "%s/ppp-%s.pid",
PPP_PATH_VARRUN, linkname);
if ((pidfile = fopen(linkpidfile, "w")) != NULL) {
fprintf(pidfile, "%d\n", pid);