mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: torvalds@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Fix initramfs permissions on directories and special files
Date: Wed, 10 Sep 2003 18:29:16 +1000	[thread overview]
Message-ID: <20030910082916.GE1532@krispykreme> (raw)


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);

_

                 reply	other threads:[~2003-09-10  8:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030910082916.GE1532@krispykreme \
    --to=anton@samba.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®