apm suspend broken ?
I have a question related to this.
If a driver ioctl handler requires
(filp->f_mode) & FMODE_WRITE
to be set before processing a request, and if only root has write permission to the device file, does this make it unnecessary to check for
capable(CAP_SYS_ADMIN)
?
If we were to use the write permission bit to control access, then it would not be necessary for the apm command to be setuid root to give the non-root user the ability to suspend the machine. Instead we could
chgrp apm /dev/apm_bios
chmod g+w /dev/apm_bios
and add the trusted user to the 'apm' group.
Am I missing something here?
--
Thomas
Hi Thomas,
Quoted 10 lines · On 30 Oct 2001 11:18:17 -0500 Thomas Hood <[email protected]> wrote:
If we were to use the write permission bit to control access, then it would not be necessary for the apm command to be setuid root to give the non-root user the ability to suspend the machine. Instead we could
chgrp apm/dev/apm_bios
chmod g+w/dev/apm_bios
and add the trusted user to the 'apm' group.Am I missing something here?
No, you are not missing anything and I did consider the other part of your patch, but was not brave enough to apply it when the kernel was "frozen". However, the freeze lasted much longer than I expected :-)
I guess the original intention was that we would be able to add capablilites to executable (much as we add setuid bits) and to users, but that also seems to have taken a while to emerge. I think, though, that I have seen a PAM module for adding capabilities to users at login time.
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/