Re: [PATCH] led-class.c permission change

Alan Cox
2007-05-06T12:34:16Z

> > 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.