[PATCH 2/2] procd: clean up /dev/pts mounts

Rui Salvaterra rsalvaterra at gmail.com
Sun Jan 9 15:27:28 PST 2022


The default mode is already 600, no need to specify it. Access times are also
irrelevant.

Signed-off-by: Rui Salvaterra <rsalvaterra at gmail.com>
---
 initd/early.c   | 2 +-
 plug/coldplug.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/initd/early.c b/initd/early.c
index 87fee65..4b7e61c 100644
--- a/initd/early.c
+++ b/initd/early.c
@@ -64,7 +64,7 @@ early_mounts(void)
 		mount("tmpfs", "/dev", "tmpfs", MS_NOATIME | MS_NOEXEC | MS_NOSUID, "mode=0755,size=512K");
 		ignore(symlink("/tmp/shm", "/dev/shm"));
 		mkdir("/dev/pts", 0755);
-		mount("devpts", "/dev/pts", "devpts", MS_NOATIME | MS_NOEXEC | MS_NOSUID, "mode=600");
+		mount("devpts", "/dev/pts", "devpts", MS_NOATIME | MS_NOEXEC | MS_NOSUID, 0);
 
 		early_dev();
 	}
diff --git a/plug/coldplug.c b/plug/coldplug.c
index b9462e7..308b79d 100644
--- a/plug/coldplug.c
+++ b/plug/coldplug.c
@@ -50,7 +50,7 @@ void procd_coldplug(void)
 		umount2("/dev/", MNT_DETACH);
 		mount("tmpfs", "/dev", "tmpfs", MS_NOATIME | MS_NOEXEC | MS_NOSUID, "mode=0755,size=512K");
 		mkdir("/dev/pts", 0755);
-		mount("devpts", "/dev/pts", "devpts", MS_NOEXEC | MS_NOSUID, 0);
+		mount("devpts", "/dev/pts", "devpts", MS_NOATIME | MS_NOEXEC | MS_NOSUID, 0);
 	}
 
 	ignore(symlink("/tmp/shm", "/dev/shm"));
-- 
2.34.1




More information about the openwrt-devel mailing list