]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix initramfs permissions on directories and special files
authorAnton Blanchard <anton@samba.org>
Wed, 10 Sep 2003 02:39:55 +0000 (19:39 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Wed, 10 Sep 2003 02:39:55 +0000 (19:39 -0700)
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.

init/initramfs.c

index cbd1a538d85e3fcd31b0bd96b3f8ff20d75820a8..7bbb68275983f6a744f015c2cb036e26e0b12b99 100644 (file)
@@ -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);