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>
Cette révision appartient à :

révisé par
Live-CD User

Parent
78f28b7c55
révision
e454cea20b
@@ -1057,14 +1057,14 @@ static const struct file_operations usblp_fops = {
|
||||
.release = usblp_release,
|
||||
};
|
||||
|
||||
static char *usblp_nodename(struct device *dev)
|
||||
static char *usblp_devnode(struct device *dev, mode_t *mode)
|
||||
{
|
||||
return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev));
|
||||
}
|
||||
|
||||
static struct usb_class_driver usblp_class = {
|
||||
.name = "lp%d",
|
||||
.nodename = usblp_nodename,
|
||||
.devnode = usblp_devnode,
|
||||
.fops = &usblp_fops,
|
||||
.minor_base = USBLP_MINOR_BASE,
|
||||
};
|
||||
|
Référencer dans un nouveau ticket
Bloquer un utilisateur