On 1/3/06, Joachim Schipper <[EMAIL PROTECTED]> wrote: > > Since /etc/X11/xdm/TakeConsole runs with root permission on every user > > logout to prevent /dev/console sniffing I modified it to perform the > > shutdown if the flag file is found in the users home directory. > > > > # cat /etc/X11/xdm/TakeConsole > > #!/bin/sh > > # Reassign ownership of the console to root, this should disallow > > # assignment of console output to any random users's xterm > > # $Xorg: TakeConsole,v 1.3 2000/08/17 19:54:17 cpqbld Exp $ > > # $OpenBSD: TakeConsole,v 1.3 2004/11/03 00:22:21 matthieu Exp $ > > # > > chmod 622 /dev/console > > chown root /dev/console > > /usr/X11R6/bin/sessreg -d -l $DISPLAY -u /var/run/utmp \ > > -x /usr/X11R6/lib/X11/xdm/Xservers $USER > > > > if [ -f "$HOME/.xshutdown" ]; then > > shutdown -hp now > > fi > > # > > > > This approach works perfectly but my questions are: > > Is there anything wrong with this approach? > > Is there's a better way to deal with the problem? > > This is a hack. It will work, untill you upgrade X11 without being very > careful. > > Why not just configure sudo to allow access to /sbin/halt without a > password from user dad? Of course, you then alter the KDE menu to do it > your way. And/or place a two-line shell script in ~dad/bin/halt: > Add dad to the operator group which can run /sbin/shutdown without sudo.
-- http://erdelynet.com/ Support OpenBSD! http://www.openbsd.org/orders.html