[PATCH] Fix initramfs permissions on directories and special files

From: Anton Blanchard
Date: Wed Sep 10 2003 - 03:34:40 EST



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.


work-anton/init/initramfs.c | 2 ++
1 files changed, 2 insertions(+)

diff -puN init/initramfs.c~initramfs-fix init/initramfs.c
--- work/init/initramfs.c~initramfs-fix 2003-09-10 03:11:58.000000000 -0500
+++ work-anton/init/initramfs.c 2003-09-10 03:11:58.000000000 -0500
@@ -260,11 +260,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);

_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/