]>
Commit | Line | Data |
---|---|---|
bf9c4da7 SZ |
1 | diff -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; |