]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
HID: prodikeys: make sysfs permissions more strict
authorJiri Kosina <jkosina@suse.cz>
Thu, 18 Nov 2010 15:27:07 +0000 (16:27 +0100)
committerJiri Kosina <jkosina@suse.cz>
Thu, 18 Nov 2010 15:30:34 +0000 (16:30 +0100)
It's not really dangerous in this driver, but it's against general
practice and worth fixing.

Proper place for handling this correctly is udev.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-prodikeys.c

index 48eab84f53b5467acac72ad1ff57b2f3c79f4c9d..5f0fa6c1bf87a1936ca8f27a386b918cdfd435c3 100644 (file)
@@ -130,7 +130,7 @@ static ssize_t store_channel(struct device *dev,
        return -EINVAL;
 }
 
-static DEVICE_ATTR(channel, S_IRUGO | S_IWUGO, show_channel,
+static DEVICE_ATTR(channel, S_IRUGO | S_IWUSR | S_IWGRP , show_channel,
                store_channel);
 
 static struct device_attribute *sysfs_device_attr_channel = {
@@ -169,7 +169,7 @@ static ssize_t store_sustain(struct device *dev,
        return -EINVAL;
 }
 
-static DEVICE_ATTR(sustain, S_IRUGO | S_IWUGO, show_sustain,
+static DEVICE_ATTR(sustain, S_IRUGO | S_IWUSR | S_IWGRP, show_sustain,
                store_sustain);
 
 static struct device_attribute *sysfs_device_attr_sustain = {
@@ -207,7 +207,7 @@ static ssize_t store_octave(struct device *dev,
        return -EINVAL;
 }
 
-static DEVICE_ATTR(octave, S_IRUGO | S_IWUGO, show_octave,
+static DEVICE_ATTR(octave, S_IRUGO | S_IWUSR | S_IWGRP, show_octave,
                store_octave);
 
 static struct device_attribute *sysfs_device_attr_octave = {