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 /include/linux/device.h | |
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 'include/linux/device.h')
-rw-r--r-- | include/linux/device.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 847b763e40e9..aca31bf7d8ed 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -193,7 +193,7 @@ struct class { | |||
193 | struct kobject *dev_kobj; | 193 | struct kobject *dev_kobj; |
194 | 194 | ||
195 | int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); | 195 | int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); |
196 | char *(*nodename)(struct device *dev); | 196 | char *(*devnode)(struct device *dev, mode_t *mode); |
197 | 197 | ||
198 | void (*class_release)(struct class *class); | 198 | void (*class_release)(struct class *class); |
199 | void (*dev_release)(struct device *dev); | 199 | void (*dev_release)(struct device *dev); |
@@ -298,7 +298,7 @@ struct device_type { | |||
298 | const char *name; | 298 | const char *name; |
299 | const struct attribute_group **groups; | 299 | const struct attribute_group **groups; |
300 | int (*uevent)(struct device *dev, struct kobj_uevent_env *env); | 300 | int (*uevent)(struct device *dev, struct kobj_uevent_env *env); |
301 | char *(*nodename)(struct device *dev); | 301 | char *(*devnode)(struct device *dev, mode_t *mode); |
302 | void (*release)(struct device *dev); | 302 | void (*release)(struct device *dev); |
303 | 303 | ||
304 | const struct dev_pm_ops *pm; | 304 | const struct dev_pm_ops *pm; |
@@ -487,7 +487,8 @@ extern struct device *device_find_child(struct device *dev, void *data, | |||
487 | extern int device_rename(struct device *dev, char *new_name); | 487 | extern int device_rename(struct device *dev, char *new_name); |
488 | extern int device_move(struct device *dev, struct device *new_parent, | 488 | extern int device_move(struct device *dev, struct device *new_parent, |
489 | enum dpm_order dpm_order); | 489 | enum dpm_order dpm_order); |
490 | extern const char *device_get_nodename(struct device *dev, const char **tmp); | 490 | extern const char *device_get_devnode(struct device *dev, |
491 | mode_t *mode, const char **tmp); | ||
491 | extern void *dev_get_drvdata(const struct device *dev); | 492 | extern void *dev_get_drvdata(const struct device *dev); |
492 | extern void dev_set_drvdata(struct device *dev, void *data); | 493 | extern void dev_set_drvdata(struct device *dev, void *data); |
493 | 494 | ||