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/aoe | |
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/aoe')
-rw-r--r-- | drivers/block/aoe/aoechr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c index 19888354188..62141ec09a2 100644 --- a/drivers/block/aoe/aoechr.c +++ b/drivers/block/aoe/aoechr.c | |||
@@ -266,7 +266,7 @@ static const struct file_operations aoe_fops = { | |||
266 | .owner = THIS_MODULE, | 266 | .owner = THIS_MODULE, |
267 | }; | 267 | }; |
268 | 268 | ||
269 | static char *aoe_nodename(struct device *dev) | 269 | static char *aoe_devnode(struct device *dev, mode_t *mode) |
270 | { | 270 | { |
271 | return kasprintf(GFP_KERNEL, "etherd/%s", dev_name(dev)); | 271 | return kasprintf(GFP_KERNEL, "etherd/%s", dev_name(dev)); |
272 | } | 272 | } |
@@ -288,7 +288,7 @@ aoechr_init(void) | |||
288 | unregister_chrdev(AOE_MAJOR, "aoechr"); | 288 | unregister_chrdev(AOE_MAJOR, "aoechr"); |
289 | return PTR_ERR(aoe_class); | 289 | return PTR_ERR(aoe_class); |
290 | } | 290 | } |
291 | aoe_class->nodename = aoe_nodename; | 291 | aoe_class->devnode = aoe_devnode; |
292 | 292 | ||
293 | for (i = 0; i < ARRAY_SIZE(chardevs); ++i) | 293 | for (i = 0; i < ARRAY_SIZE(chardevs); ++i) |
294 | device_create(aoe_class, NULL, | 294 | device_create(aoe_class, NULL, |