diff -Naur pppd.orig/auth.c pppd/auth.c
--- pppd.orig/auth.c	2023-03-25 05:38:30.000000000 +0100
+++ pppd/auth.c	2023-06-30 12:38:13.748482796 +0200
@@ -518,7 +518,7 @@
         free(fname);
 	return 0;
     }
-    ufile = fopen(fname, "r");
+    ufile = fopen(fname, "re");
     if (seteuid(euid) == -1)
 	fatal("unable to regain privileges: %m");
     if (ufile == NULL) {
@@ -1535,7 +1535,7 @@
     filename = PPP_PATH_UPAPFILE;
     addrs = opts = NULL;
     ret = UPAP_AUTHNAK;
-    f = fopen(filename, "r");
+    f = fopen(filename, "re");
     if (f == NULL) {
 	error("Can't open PAP password file %s: %m", filename);
 
@@ -1635,7 +1635,7 @@
     if (ret <= 0) {
 	filename = PPP_PATH_UPAPFILE;
 	addrs = NULL;
-	f = fopen(filename, "r");
+	f = fopen(filename, "re");
 	if (f == NULL)
 	    return 0;
 	check_access(f, filename);
@@ -1681,7 +1681,7 @@
     }
 
     filename = PPP_PATH_UPAPFILE;
-    f = fopen(filename, "r");
+    f = fopen(filename, "re");
     if (f == NULL)
 	return 0;
     check_access(f, filename);
@@ -1718,7 +1718,7 @@
     }
 
     filename = PPP_PATH_UPAPFILE;
-    f = fopen(filename, "r");
+    f = fopen(filename, "re");
     if (f == NULL)
 	return 0;
 
@@ -1760,7 +1760,7 @@
     }
 
     filename = PPP_PATH_CHAPFILE;
-    f = fopen(filename, "r");
+    f = fopen(filename, "re");
     if (f == NULL)
 	return 0;
 
@@ -1798,7 +1798,7 @@
     struct wordlist *addrs;
 
     filename = PPP_PATH_SRPFILE;
-    f = fopen(filename, "r");
+    f = fopen(filename, "re");
     if (f == NULL)
 	return 0;
 
@@ -1849,7 +1849,7 @@
 	addrs = NULL;
 	secbuf[0] = 0;
 
-	f = fopen(filename, "r");
+	f = fopen(filename, "re");
 	if (f == NULL) {
 	    error("Can't open chap secret file %s: %m", filename);
 	    return 0;
@@ -1902,7 +1902,7 @@
 	filename = PPP_PATH_SRPFILE;
 	addrs = NULL;
 
-	fp = fopen(filename, "r");
+	fp = fopen(filename, "re");
 	if (fp == NULL) {
 	    error("Can't open srp secret file %s: %m", filename);
 	    return 0;
@@ -2291,7 +2291,7 @@
 	     */
 	    if (word[0] == '@' && word[1] == '/') {
 		strlcpy(atfile, word+1, sizeof(atfile));
-		if ((sf = fopen(atfile, "r")) == NULL) {
+		if ((sf = fopen(atfile, "re")) == NULL) {
 		    warn("can't open indirect secret file %s", atfile);
 		    continue;
 		}
@@ -2461,7 +2461,7 @@
     char pkfile[MAXWORDLEN];
 
     filename = PPP_PATH_EAPTLSSERVFILE;
-    f = fopen(filename, "r");
+    f = fopen(filename, "re");
     if (f == NULL)
 		return 0;
 
@@ -2518,7 +2518,7 @@
 		return 1;
 
     filename = PPP_PATH_EAPTLSCLIFILE;
-    f = fopen(filename, "r");
+    f = fopen(filename, "re");
     if (f == NULL)
 		return 0;
 
@@ -2738,7 +2738,7 @@
 		filename = (am_server ? PPP_PATH_EAPTLSSERVFILE : PPP_PATH_EAPTLSCLIFILE);
 		addrs = NULL;
 
-		fp = fopen(filename, "r");
+		fp = fopen(filename, "re");
 		if (fp == NULL)
 		{
 			error("Can't open eap-tls secret file %s: %m", filename);
diff -Naur pppd.orig/options.c pppd/options.c
--- pppd.orig/options.c	2023-03-25 05:38:30.000000000 +0100
+++ pppd/options.c	2023-06-30 12:42:19.262593140 +0200
@@ -555,7 +555,7 @@
 	ppp_option_error("unable to drop privileges to open %s: %m", filename);
 	return 0;
     }
-    f = fopen(filename, "r");
+    f = fopen(filename, "re");
     err = errno;
     if (check_prot && seteuid(euid) == -1)
 	fatal("unable to regain privileges");
diff -Naur pppd.orig/sys-linux.c pppd/sys-linux.c
--- pppd.orig/sys-linux.c	2023-03-10 02:50:41.000000000 +0100
+++ pppd/sys-linux.c	2023-06-30 12:43:20.634453475 +0200
@@ -1978,7 +1978,7 @@
 	/* Default the mount location of /proc */
 	strlcpy (proc_path, "/proc", sizeof(proc_path));
 	proc_path_len = 5;
-	fp = fopen(MOUNTED, "r");
+	fp = fopen(MOUNTED, "re");
 	if (fp != NULL) {
 	    while ((mntent = getmntent(fp)) != NULL) {
 		if (strcmp(mntent->mnt_type, MNTTYPE_IGNORE) == 0)
@@ -2038,7 +2038,7 @@
     close_route_table();
 
     path = path_to_procfs("/net/route");
-    route_fd = fopen (path, "r");
+    route_fd = fopen (path, "re");
     if (route_fd == NULL) {
 	error("can't open routing table %s: %m", path);
 	return 0;
@@ -2322,7 +2322,7 @@
     close_route_table();
 
     path = path_to_procfs("/net/ipv6_route");
-    route_fd = fopen (path, "r");
+    route_fd = fopen (path, "re");
     if (route_fd == NULL) {
 	error("can't open routing table %s: %m", path);
 	return 0;
