mirror of
https://github.com/troglobit/finit.git
synced 2026-10-03 14:33:12 +07:00
Fix #462: /dev/pts mounted with wrong mode
Before this fix:
admin@infix:~$ sudo ls -la /dev/pts/
total 0
drwxr-xr-x 2 root root 0 Dec 24 08:16 .
drwxr-xr-x 13 root root 13340 Dec 24 08:16 ..
cr-------- 1 root tty 136, 0 Dec 24 08:18 0
crw-rw-rw- 1 root root 5, 2 Dec 24 08:16 ptmx
admin@infix:~$ mount | grep devpts
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=400,ptmxmode=666)
After:
admin@infix-00-00-00:~$ sudo ls -l /dev/pts/
total 0
crw--w---- 1 root tty 136, 0 Dec 24 08:21 0
crw-rw-rw- 1 root root 5, 2 Dec 24 08:20 ptmx
admin@infix-00-00-00:~$ mount |grep pts
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=666)
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+1
-3
@@ -371,7 +371,6 @@ static void fs_finalize(void)
|
||||
/* Modern systems use /dev/pts */
|
||||
if (!fismnt("/dev/pts")) {
|
||||
char opts[32];
|
||||
int mode;
|
||||
int gid;
|
||||
|
||||
gid = getgroup("tty");
|
||||
@@ -379,8 +378,7 @@ static void fs_finalize(void)
|
||||
gid = 0;
|
||||
|
||||
/* 0600 is default on Debian, use 0620 to get mesg y by default */
|
||||
mode = 0620;
|
||||
snprintf(opts, sizeof(opts), "gid=%d,mode=%d,ptmxmode=0666", gid, mode);
|
||||
snprintf(opts, sizeof(opts), "gid=%d,mode=0620,ptmxmode=0666", gid);
|
||||
|
||||
makedir("/dev/pts", 0755);
|
||||
fs_mount("devpts", "/dev/pts", "devpts", flags, opts);
|
||||
|
||||
Reference in New Issue
Block a user