diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2009-09-18 17:01:12 -0400 |
---|---|---|
committer | Live-CD User <linux@linux.site> | 2009-09-19 15:50:38 -0400 |
commit | e454cea20bdcff10ee698d11b8882662a0153a47 (patch) | |
tree | f44581fe57787aef0a4f4dc00993a90ea8e688f6 /block/genhd.c | |
parent | 78f28b7c555359c67c2a0d23f7436e915329421e (diff) |
Driver-Core: extend devnode callbacks to provide permissions
This allows subsytems to provide devtmpfs with non-default permissions
for the device node. Instead of the default mode of 0600, null, zero,
random, urandom, full, tty, ptmx now have a mode of 0666, which allows
non-privileged processes to access standard device nodes in case no
other userspace process applies the expected permissions.
This also fixes a wrong assignment in pktcdvd and a checkpatch.pl complain.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'block/genhd.c')
-rw-r--r-- | block/genhd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/block/genhd.c b/block/genhd.c index 2ad91ddad8e2..517e4332cb37 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -998,12 +998,12 @@ struct class block_class = { | |||
998 | .name = "block", | 998 | .name = "block", |
999 | }; | 999 | }; |
1000 | 1000 | ||
1001 | static char *block_nodename(struct device *dev) | 1001 | static char *block_devnode(struct device *dev, mode_t *mode) |
1002 | { | 1002 | { |
1003 | struct gendisk *disk = dev_to_disk(dev); | 1003 | struct gendisk *disk = dev_to_disk(dev); |
1004 | 1004 | ||
1005 | if (disk->nodename) | 1005 | if (disk->devnode) |
1006 | return disk->nodename(disk); | 1006 | return disk->devnode(disk, mode); |
1007 | return NULL; | 1007 | return NULL; |
1008 | } | 1008 | } |
1009 | 1009 | ||
@@ -1011,7 +1011,7 @@ static struct device_type disk_type = { | |||
1011 | .name = "disk", | 1011 | .name = "disk", |
1012 | .groups = disk_attr_groups, | 1012 | .groups = disk_attr_groups, |
1013 | .release = disk_release, | 1013 | .release = disk_release, |
1014 | .nodename = block_nodename, | 1014 | .devnode = block_devnode, |
1015 | }; | 1015 | }; |
1016 | 1016 | ||
1017 | #ifdef CONFIG_PROC_FS | 1017 | #ifdef CONFIG_PROC_FS |