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 /drivers/block/pktcdvd.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 'drivers/block/pktcdvd.c')
-rw-r--r-- | drivers/block/pktcdvd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 95f11cdef203..fd5bb8ad59a9 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -2857,7 +2857,7 @@ static struct block_device_operations pktcdvd_ops = { | |||
2857 | .media_changed = pkt_media_changed, | 2857 | .media_changed = pkt_media_changed, |
2858 | }; | 2858 | }; |
2859 | 2859 | ||
2860 | static char *pktcdvd_nodename(struct gendisk *gd) | 2860 | static char *pktcdvd_devnode(struct gendisk *gd, mode_t *mode) |
2861 | { | 2861 | { |
2862 | return kasprintf(GFP_KERNEL, "pktcdvd/%s", gd->disk_name); | 2862 | return kasprintf(GFP_KERNEL, "pktcdvd/%s", gd->disk_name); |
2863 | } | 2863 | } |
@@ -2914,7 +2914,7 @@ static int pkt_setup_dev(dev_t dev, dev_t* pkt_dev) | |||
2914 | disk->fops = &pktcdvd_ops; | 2914 | disk->fops = &pktcdvd_ops; |
2915 | disk->flags = GENHD_FL_REMOVABLE; | 2915 | disk->flags = GENHD_FL_REMOVABLE; |
2916 | strcpy(disk->disk_name, pd->name); | 2916 | strcpy(disk->disk_name, pd->name); |
2917 | disk->nodename = pktcdvd_nodename; | 2917 | disk->devnode = pktcdvd_devnode; |
2918 | disk->private_data = pd; | 2918 | disk->private_data = pd; |
2919 | disk->queue = blk_alloc_queue(GFP_KERNEL); | 2919 | disk->queue = blk_alloc_queue(GFP_KERNEL); |
2920 | if (!disk->queue) | 2920 | if (!disk->queue) |
@@ -3070,7 +3070,7 @@ static const struct file_operations pkt_ctl_fops = { | |||
3070 | static struct miscdevice pkt_misc = { | 3070 | static struct miscdevice pkt_misc = { |
3071 | .minor = MISC_DYNAMIC_MINOR, | 3071 | .minor = MISC_DYNAMIC_MINOR, |
3072 | .name = DRIVER_NAME, | 3072 | .name = DRIVER_NAME, |
3073 | .name = "pktcdvd/control", | 3073 | .nodename = "pktcdvd/control", |
3074 | .fops = &pkt_ctl_fops | 3074 | .fops = &pkt_ctl_fops |
3075 | }; | 3075 | }; |
3076 | 3076 | ||