linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Rosenstand <rosenstand@gmail.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: devtmpfs default permissions
Date: Tue, 03 Nov 2009 01:24:06 +0000	[thread overview]
Message-ID: <1257211446.4647.5.camel@mjollnir> (raw)
In-Reply-To: <1256824970.30238.25.camel@mjollnir>

On Fri, 2009-10-30 at 12:48 +0100, Kay Sievers wrote:
> On Fri, 2009-10-30 at 00:53 +0100, Mark Rosenstand wrote:
> > On Thu, 2009-10-29 at 18:12 +0100, Kay Sievers wrote:
> > > On Thursday, October 29, 2009, Greg KH <greg@kroah.com> wrote:
> > > > On Thu, Oct 29, 2009 at 03:02:50PM +0100, Mark Rosenstand wrote:
> > > >>
> > > >> I've been using the devtmpfs patch for 2.6.31 and recently mainline
> > > >> 2.6.32-rc5.  I've noticed that /dev now have default tmpfs permissions,
> > > >> i.e. 1777.
> > > >>
> > > >> One can chmod the directory, but would it not make sense to use a more
> > > >> less permissive mode (e.g. 0755) by default?
> > > 
> > > Yeah, sounds good.
> > > 
> > > > I think the patch sent by Kay to the linux-kernel mailing list yesterday
> > > > will solve this problem.  It uses the default umask instead.
> > > >
> > > > Can you test it out to verify this?
> > 
> > Default umask would probably be even better than a hardcoded one. Just
> > tried latest git, seems to still get 1777 permissions.
> > 
> > > I'll prepare a patch to fix that, we need to pass "mode\a55" to the
> > > mount command, to set the tmpfs root directory mode.
> > 
> > Thanks guys, rock on! :)
> 
> Thanks! This works for me.
> 
> 
> From: Kay Sievers <kay.sievers@vrfy.org>
> Subject: Driver-Core: devtmpfs - set root directory mode to 0755
> 
> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
> ---
>  drivers/base/devtmpfs.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/drivers/base/devtmpfs.c
> +++ b/drivers/base/devtmpfs.c
> @@ -359,7 +359,7 @@ int __init devtmpfs_init(void)
>  		return err;
>  	}
>  
> -	mnt = kern_mount(&dev_fs_type);
> +	mnt = kern_mount_data(&dev_fs_type, "mode\a55");
>  	if (IS_ERR(mnt)) {
>  		err = PTR_ERR(mnt);
>  		printk(KERN_ERR "devtmpfs: unable to create devtmpfs %i\n", err);

Works here too. Getting this on the console, though:

tmpfs: No value for mount option 'mode'

But hey, it works. Thanks :)


  parent reply	other threads:[~2009-11-03  1:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-29 14:02 devtmpfs default permissions Mark Rosenstand
2009-10-29 16:35 ` Greg KH
2009-10-29 17:12 ` Kay Sievers
2009-10-29 23:53 ` Mark Rosenstand
2009-10-30 11:48 ` Kay Sievers
2009-11-03  1:24 ` Mark Rosenstand [this message]
2009-11-04 15:25 ` Kay Sievers
2009-11-05 19:42 ` Kay Sievers
2009-11-05 21:01 ` Greg KH
2009-11-05 22:40 ` Kay Sievers

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=1257211446.4647.5.camel@mjollnir \
    --to=rosenstand@gmail.com \
    --cc=linux-hotplug@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).