]> git.pld-linux.org Git - packages/ppp.git/blame - ppp-pidfile-owner.patch
- not so nice hacks, but now works with pppd 2.4.2
[packages/ppp.git] / ppp-pidfile-owner.patch
CommitLineData
bf9c4da7
SZ
1diff -Naur ppp-2.4.1/pppd/main.c ppp-2.4.1-p/pppd/main.c
2--- ppp-2.4.1/pppd/main.c Thu May 16 11:34:27 2002
3+++ ppp-2.4.1-p/pppd/main.c Thu May 16 11:36:43 2002
4@@ -795,6 +795,11 @@
5 if ((pidfile = fopen(pidfilename, "w")) != NULL) {
6 fprintf(pidfile, "%d\n", getpid());
7 (void) fclose(pidfile);
8+ if (getuid() != geteuid()) {
9+ if ((chown(pidfilename, getuid(), -1)) < 0) {
10+ error("Failed to chown pid file %s: %m", pidfilename);
11+ }
12+ }
13 } else {
14 error("Failed to create pid file %s: %m", pidfilename);
15 pidfilename[0] = 0;
16@@ -816,6 +821,11 @@
17 if (ifname[0])
18 fprintf(pidfile, "%s\n", ifname);
19 (void) fclose(pidfile);
20+ if (getuid() != geteuid()) {
21+ if ((chown(linkpidfile, getuid(), -1)) < 0) {
22+ error("Failed to chown pid file %s: %m", linkpidfile);
23+ }
24+ }
25 } else {
26 error("Failed to create pid file %s: %m", linkpidfile);
27 linkpidfile[0] = 0;
This page took 0.042342 seconds and 4 git commands to generate.