Skip to content

Mount /dev/pts with incorect mode #462

@KCIRREM

Description

@KCIRREM

it mounts /dev/pts with the following devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=400,ptmxmode=666) even though it should be 620 unless I patch the mode line in finit.c

gid = getgroup("tty");
if (gid == -1)
    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);

makedir("/dev/pts", 0755);
fs_mount("devpts", "/dev/pts", "devpts", flags, opts);
gid = getgroup("tty");
if (gid == -1)
    gid = 0;

mode = 620;  // decimal for mount options (remove 0)
snprintf(opts, sizeof(opts), "gid=%d,mode=%d,ptmxmode=0666", gid, mode);

makedir("/dev/pts", 0755);
fs_mount("devpts", "/dev/pts", "devpts", flags, opts);

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions