aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2003-09-09 19:39:55 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-09-09 19:39:55 -0700
commit6fd5c7bf5c800c3083343d273f45dc5fc1b53da1 (patch)
tree2dd825c6692eb4313d2cacd1175108a6bee1ed4e /init
parentbda366d744be7e7496ee78a5c663881cfb301ebc (diff)
downloadhistory-6fd5c7bf5c800c3083343d273f45dc5fc1b53da1.tar.gz
[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.
Diffstat (limited to 'init')
-rw-r--r--init/initramfs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/init/initramfs.c b/init/initramfs.c
index cbd1a538d85e3f..7bbb68275983f6 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -261,11 +261,13 @@ static int __init do_name(void)
} else if (S_ISDIR(mode)) {
sys_mkdir(collected, mode);
sys_chown(collected, uid, gid);
+ sys_chmod(collected, mode);
} else if (S_ISBLK(mode) || S_ISCHR(mode) ||
S_ISFIFO(mode) || S_ISSOCK(mode)) {
if (maybe_link() == 0) {
sys_mknod(collected, mode, rdev);
sys_chown(collected, uid, gid);
+ sys_chmod(collected, mode);
}
} else
panic("populate_root: bogus mode: %o\n", mode);