Input: atmel_mxt_ts - only allow root to update firmware
authorDaniel Kurtz <djkurtz@chromium.org>
Wed, 9 May 2012 05:30:14 +0000 (22:30 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 11 May 2012 03:39:05 +0000 (20:39 -0700)
Restrict permissions on the update_fw sysfs entry to read only for root
only.

Also, update object permission to use a macro S_IRUGO macro instead of
hard coded 0444.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Nick Dyer <nick.dyer@itdev.co.uk>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/touchscreen/atmel_mxt_ts.c

index 0a6e368a5a9cc8accb0af986bf8e16bfac6d909a..15ae6fd575b2ba1a472648206b58af108ff0759b 100644 (file)
@@ -1049,8 +1049,8 @@ static ssize_t mxt_update_fw_store(struct device *dev,
        return count;
 }
 
-static DEVICE_ATTR(object, 0444, mxt_object_show, NULL);
-static DEVICE_ATTR(update_fw, 0664, NULL, mxt_update_fw_store);
+static DEVICE_ATTR(object, S_IRUGO, mxt_object_show, NULL);
+static DEVICE_ATTR(update_fw, S_IWUSR, NULL, mxt_update_fw_store);
 
 static struct attribute *mxt_attrs[] = {
        &dev_attr_object.attr,