Commit 6fd5c7bf authored by Anton Blanchard's avatar Anton Blanchard Committed by Linus Torvalds

[PATCH] Fix initramfs permissions on directories and special files

Set correct permissions on initramfs directories and special files. We dont
want to obey the umask here, so do the same thing we do on normal files -
call sys_chmod.
parent bda366d7
...@@ -261,11 +261,13 @@ static int __init do_name(void) ...@@ -261,11 +261,13 @@ static int __init do_name(void)
} else if (S_ISDIR(mode)) { } else if (S_ISDIR(mode)) {
sys_mkdir(collected, mode); sys_mkdir(collected, mode);
sys_chown(collected, uid, gid); sys_chown(collected, uid, gid);
sys_chmod(collected, mode);
} else if (S_ISBLK(mode) || S_ISCHR(mode) || } else if (S_ISBLK(mode) || S_ISCHR(mode) ||
S_ISFIFO(mode) || S_ISSOCK(mode)) { S_ISFIFO(mode) || S_ISSOCK(mode)) {
if (maybe_link() == 0) { if (maybe_link() == 0) {
sys_mknod(collected, mode, rdev); sys_mknod(collected, mode, rdev);
sys_chown(collected, uid, gid); sys_chown(collected, uid, gid);
sys_chmod(collected, mode);
} }
} else } else
panic("populate_root: bogus mode: %o\n", mode); panic("populate_root: bogus mode: %o\n", mode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment