tazpanel rev 562

lib/libtazpanel: no hardcoded port 82
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Dec 29 16:13:21 2015 +0100 (2015-12-29)
parents 55bcf1479c23
children af9f79648680
files lib/libtazpanel
line diff
     1.1 --- a/lib/libtazpanel	Tue Dec 29 15:51:34 2015 +0100
     1.2 +++ b/lib/libtazpanel	Tue Dec 29 16:13:21 2015 +0100
     1.3 @@ -15,11 +15,11 @@
     1.4  
     1.5  
     1.6  GUI_USER=nobody
     1.7 -[ "$HTTP_HOST" == "127.0.0.1:82" ] &&
     1.8 +[ "${HTTP_HOST/:*/:}" == "127.0.0.1:" ] &&
     1.9  for i in "$HTTP_COOKIE" "$QUERY_STRING" ; do
    1.10  	v="$(echo "$i" | sed '/guiuser=/!d;s/.*guiuser=\([A-Za-z0-9_]*\).*/\1/')"
    1.11  	[ "$v" ] || continue
    1.12 -	busybox ps | sed '/d;/d;/127\.0\.0\.1:82/!d' | grep -q " $v " || continue
    1.13 +	busybox ps | sed '/d;/d;/127\.0\.0\.1:/!d' | grep -q " $v " || continue
    1.14  	GUI_USER="$v"
    1.15  done
    1.16  [ "$(id -un)" == "${REMOTE_USER:=$GUI_USER}" ] || exec su -s /bin/sh -c "$(realpath $0) $@" $REMOTE_USER