Skip to contentSkip to conversation

backlight: lm3639_bl: Fix up world writable sysfs file

PATCH In review Axel Lin 2 participants 2 messages Oct 29, 2012

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 backlight: lm3639_bl: Fix up world writable sysfs file

We don't need the sysfs file to be world writable or group writable. This file is write-only, change it to S_IWUSR (0200).

---
 drivers/video/backlight/lm3639_bl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/backlight/lm3639_bl.c +1 -1
index 585949b..6f7a20e 100644
@@ -214,7 +214,7 @@ out_input:
 
 }
 
-static DEVICE_ATTR(bled_mode, 0666, NULL, lm3639_bled_mode_store);
+static DEVICE_ATTR(bled_mode, S_IWUSR, NULL, lm3639_bled_mode_store);
 
 /* torch */
 static void lm3639_torch_brightness_set(struct led_classdev *cdev,
Signature · 1 line
1.7.9.5
Acked-by on v1 1/1
#1 lore raw

2012년 10월 29일 17:38, Axel Lin 쓴 글:

Quoted 13 lines

We don't need the sysfs file to be world writable or group writable. This file is write-only, change it to S_IWUSR (0200).

---
  drivers/video/backlight/lm3639_bl.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/backlight/lm3639_bl.c +0 -0
index 585949b..6f7a20e 100644

drivers/video/backlight/lm3639_bl.c out_input: · line 220

Quoted 8 lines
drivers/video/backlight/lm3639_bl.c +1 -1
@@ -214,7 +214,7 @@ out_input:
 
  }
 
-static DEVICE_ATTR(bled_mode, 0666, NULL, lm3639_bled_mode_store);
+static DEVICE_ATTR(bled_mode, S_IWUSR, NULL, lm3639_bled_mode_store);
 
  /* torch */
  static void lm3639_torch_brightness_set(struct led_classdev *cdev,

It's also nice to us. Thank you Alex.