Package: hibernate
Version: 2.0+15+g88d54a8-1
Severity: normal
Tags: patch

If X are started from console by 'startx' (i.e., no entry in wtmp) and
no usual window manager or desktop environment is used, then $XUSER is
set to 'root'.

The only process found by 'pidof' in setting described above is 'X'.
Unfortunately this program is 'suid root' (because of access to hw).
Thus I propose to read 'real user' instead of 'effective user':

--- a/hibernate.sh      2012-09-27 08:14:29.000000000 +0200
+++ b/hibernate.sh      2012-09-27 08:33:24.253498281 +0200
@@ -224,7 +224,7 @@ FindXServer() {
 
            xauth="`get_env_var_of_process $xpid XAUTHORITY`"
            xhome="`get_env_var_of_process $xpid HOME`"
-           xuser=`/bin/ls -ld /proc/$xpid/ | awk '{print $3}'`
+           xuser=`/bin/ps -o ruser= $xpid`
            [ -z $xauth ] && [ -n $xhome ] && [ -f $xhome/.Xauthority ] && 
xauth=$xhome/.Xauthority
 
            [ -z $xauth ] && continue


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to