Re: devtmpfs default permissions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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=0755" 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@xxxxxxxx>
Subject: Driver-Core: devtmpfs - set root directory mode to 0755

Signed-off-by: Kay Sievers <kay.sievers@xxxxxxxx>
---
 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=0755");
 	if (IS_ERR(mnt)) {
 		err = PTR_ERR(mnt);
 		printk(KERN_ERR "devtmpfs: unable to create devtmpfs %i\n", err);


--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux