1 diff -Naur pppd.orig/auth.c pppd/auth.c
2 --- pppd.orig/auth.c 2023-03-25 05:38:30.000000000 +0100
3 +++ pppd/auth.c 2023-06-30 12:38:13.748482796 +0200
8 - ufile = fopen(fname, "r");
9 + ufile = fopen(fname, "re");
10 if (seteuid(euid) == -1)
11 fatal("unable to regain privileges: %m");
14 filename = PPP_PATH_UPAPFILE;
17 - f = fopen(filename, "r");
18 + f = fopen(filename, "re");
20 error("Can't open PAP password file %s: %m", filename);
24 filename = PPP_PATH_UPAPFILE;
26 - f = fopen(filename, "r");
27 + f = fopen(filename, "re");
30 check_access(f, filename);
34 filename = PPP_PATH_UPAPFILE;
35 - f = fopen(filename, "r");
36 + f = fopen(filename, "re");
39 check_access(f, filename);
43 filename = PPP_PATH_UPAPFILE;
44 - f = fopen(filename, "r");
45 + f = fopen(filename, "re");
52 filename = PPP_PATH_CHAPFILE;
53 - f = fopen(filename, "r");
54 + f = fopen(filename, "re");
59 struct wordlist *addrs;
61 filename = PPP_PATH_SRPFILE;
62 - f = fopen(filename, "r");
63 + f = fopen(filename, "re");
71 - f = fopen(filename, "r");
72 + f = fopen(filename, "re");
74 error("Can't open chap secret file %s: %m", filename);
77 filename = PPP_PATH_SRPFILE;
80 - fp = fopen(filename, "r");
81 + fp = fopen(filename, "re");
83 error("Can't open srp secret file %s: %m", filename);
87 if (word[0] == '@' && word[1] == '/') {
88 strlcpy(atfile, word+1, sizeof(atfile));
89 - if ((sf = fopen(atfile, "r")) == NULL) {
90 + if ((sf = fopen(atfile, "re")) == NULL) {
91 warn("can't open indirect secret file %s", atfile);
95 char pkfile[MAXWORDLEN];
97 filename = PPP_PATH_EAPTLSSERVFILE;
98 - f = fopen(filename, "r");
99 + f = fopen(filename, "re");
103 @@ -2518,7 +2518,7 @@
106 filename = PPP_PATH_EAPTLSCLIFILE;
107 - f = fopen(filename, "r");
108 + f = fopen(filename, "re");
112 @@ -2738,7 +2738,7 @@
113 filename = (am_server ? PPP_PATH_EAPTLSSERVFILE : PPP_PATH_EAPTLSCLIFILE);
116 - fp = fopen(filename, "r");
117 + fp = fopen(filename, "re");
120 error("Can't open eap-tls secret file %s: %m", filename);
121 diff -Naur pppd.orig/options.c pppd/options.c
122 --- pppd.orig/options.c 2023-03-25 05:38:30.000000000 +0100
123 +++ pppd/options.c 2023-06-30 12:42:19.262593140 +0200
125 ppp_option_error("unable to drop privileges to open %s: %m", filename);
128 - f = fopen(filename, "r");
129 + f = fopen(filename, "re");
131 if (check_prot && seteuid(euid) == -1)
132 fatal("unable to regain privileges");
133 diff -Naur pppd.orig/sys-linux.c pppd/sys-linux.c
134 --- pppd.orig/sys-linux.c 2023-03-10 02:50:41.000000000 +0100
135 +++ pppd/sys-linux.c 2023-06-30 12:43:20.634453475 +0200
136 @@ -1978,7 +1978,7 @@
137 /* Default the mount location of /proc */
138 strlcpy (proc_path, "/proc", sizeof(proc_path));
140 - fp = fopen(MOUNTED, "r");
141 + fp = fopen(MOUNTED, "re");
143 while ((mntent = getmntent(fp)) != NULL) {
144 if (strcmp(mntent->mnt_type, MNTTYPE_IGNORE) == 0)
145 @@ -2038,7 +2038,7 @@
148 path = path_to_procfs("/net/route");
149 - route_fd = fopen (path, "r");
150 + route_fd = fopen (path, "re");
151 if (route_fd == NULL) {
152 error("can't open routing table %s: %m", path);
154 @@ -2322,7 +2322,7 @@
157 path = path_to_procfs("/net/ipv6_route");
158 - route_fd = fopen (path, "r");
159 + route_fd = fopen (path, "re");
160 if (route_fd == NULL) {
161 error("can't open routing table %s: %m", path);