public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] led-class.c permission change
@ 2007-05-05 10:49 Colin Leroy
  2007-05-05 21:48 ` Alan Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Colin Leroy @ 2007-05-05 10:49 UTC (permalink / raw)
  To: Richard Purdie; +Cc: linux-kernel

Hi,

This patch changes the led brightness file's permissions to 0666, so that a 
user's MUA can light up the mail LED without needing root permissions.

Thanks! 

Signed-Off-By: Colin Leroy <colin@colino.net>
--- a/drivers/leds/led-class.c	2007-05-05 12:45:20.000000000 +0200
+++ b/drivers/leds/led-class.c	2007-05-05 12:41:28.000000000 +0200
@@ -56,7 +56,7 @@ static ssize_t led_brightness_store(stru
 	return ret;
 }
 
-static CLASS_DEVICE_ATTR(brightness, 0644, led_brightness_show,
+static CLASS_DEVICE_ATTR(brightness, 0666, led_brightness_show,
 			led_brightness_store);
 #ifdef CONFIG_LEDS_TRIGGERS
 static CLASS_DEVICE_ATTR(trigger, 0644, led_trigger_show, led_trigger_store);


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] led-class.c permission change
  2007-05-05 10:49 [PATCH] led-class.c permission change Colin Leroy
@ 2007-05-05 21:48 ` Alan Cox
  2007-05-05 22:20   ` Colin Leroy
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Cox @ 2007-05-05 21:48 UTC (permalink / raw)
  To: Colin Leroy; +Cc: Richard Purdie, linux-kernel

On Sat, 5 May 2007 12:49:54 +0200
Colin Leroy <colin@colino.net> wrote:

> Hi,
> 
> This patch changes the led brightness file's permissions to 0666, so that a 
> user's MUA can light up the mail LED without needing root permissions.

NAK.

The management of user specific temporary permissions belongs in user
space with a safe "no" default value to stop background daemons doing
silly things.

Take a look at the various pam console management modules (and also beat
people up to get revoke() support into the kernel).

Alan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] led-class.c permission change
  2007-05-05 21:48 ` Alan Cox
@ 2007-05-05 22:20   ` Colin Leroy
  2007-05-06 12:37     ` Alan Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Colin Leroy @ 2007-05-05 22:20 UTC (permalink / raw)
  To: Alan Cox; +Cc: Richard Purdie, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1151 bytes --]

On 05 May 2007 at 22h05, Alan Cox wrote:

Hi, 

> > This patch changes the led brightness file's permissions to 0666,
> > so that a user's MUA can light up the mail LED without needing root
> > permissions.  
> 
> NAK.
> 
> The management of user specific temporary permissions belongs in user
> space with a safe "no" default value to stop background daemons doing
> silly things.

Mmh, ok... My usage pattern for this is for an MUA plugin[1] that does
write 1 to /sys/class/leds/asus:mail/brightness, for example, when new
mail comes. The MUA typically runs as user and until now most of the
handled LEDs had no such permission problems
(/proc/acpi/asus/mled, /proc/acpi/acer/mailled etc). 

So, I've got to find a way to write into that file as user so that
things automatically work.

> Take a look at the various pam console management modules (and also
> beat people up to get revoke() support into the kernel).

So, you suggest me to link my plugin to libpam and find something that
allows the plugin to write into /brightness? 

Thanks,

[1] http://www.claws-mail.org/plugin.php?plugin=acpinotifier
-- 
Colin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] led-class.c permission change
  2007-05-05 22:20   ` Colin Leroy
@ 2007-05-06 12:37     ` Alan Cox
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Cox @ 2007-05-06 12:37 UTC (permalink / raw)
  To: Colin Leroy; +Cc: Richard Purdie, linux-kernel

> > Take a look at the various pam console management modules (and also
> > beat people up to get revoke() support into the kernel).
> 
> So, you suggest me to link my plugin to libpam and find something that
> allows the plugin to write into /brightness? 

Much simpler than that. Most distributions have a pam module already
which updates permissions on things that the "console" user may want to
access directly (eg /dev/audio* /dev/cdrom etc) but which should
otherwise be protected from misuse (eg people with cronjobs that run
eject - an old an very funny SunOS prank)

If your distribution is like most and uses pam_console then see man 5
console.perms and add a rule to the /etc/security/console.perms file for
your file. At that point it will happily change the rights back and
forth for you as required.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-05-06 12:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-05 10:49 [PATCH] led-class.c permission change Colin Leroy
2007-05-05 21:48 ` Alan Cox
2007-05-05 22:20   ` Colin Leroy
2007-05-06 12:37     ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox