Hi,
On Samstag, September 01, 2001 at 10:35:08, Juergen Schwarting wrote:
* Am 01.09.2001 um 03:58 Uhr schrieb David Haller:
On Fre, 31 Aug 2001, Franz Zimmermann wrote:
Also X-Sitzung beenden und als User root wieder anmelden. Dann gehts.
Lieber nicht!
Lieber in einem Terminalfenster unter X mittels 'su -' zu root werden,
ein 'export DISPLAY=:0' und dann 'make -C /usr/src/linux xconfig'
aufrufen.
zuvor kann aber ein 'xhost localhost' nicht schaden ;-)
js@sam:~ > xhost +localhost
localhost being added to access control list
js@sam:~ > su -
Password:
sam:~ # export DISPLAY=:0 [1]
sam:~ # make -C /usr/src/linux xconfig
[1] Defaultmäßig ist bei mir (SuSE 7.2) DISPLAY auf 0:0 gesetzt.
Ein explizites setzten ist also nicht nötig.
Oder man spart sich gleich alles und benutzt sux [1] anstatt su.
Henne
[1] less `type -p sux`
#!/bin/bash
#
# /usr/X11R6/bin/sux A shell script to forward X authentication
# and run `su - root [options]'
#
# Usage: sux [-c command] [-s shell] [-|-l] [[user] args]
#
# Copyright 2000 SuSE GmbH
# Author: Werner Fink
#
# 2000/09/13: Avoid su staying around with magic cookie
# in process table due PAM.
export PATH=/usr/X11R6/bin/X11:$PATH
if test "+$(id -u)" = "$1" ; then
#
# Passsive part
#
unset XAUTHORITY || true
if test $# -lt 4 -o ! -e /proc/$$/fd/4 ; then
echo "${0##*/}: Missing id or cookie or DISPLAY" 1>&2
exit 1
fi
arg0=$2${SHELL##*/}
export SHELL="$3"
if test "$(hostname -f)" = "${4%:*}" ; then
export DISPLAY=":${4#*:}"
host="${4%:*}"
unixs="${host%%.*}/unix:${DISPLAY#*:}"
unixf="${host}/unix:${DISPLAY#*:}"
tcpip="${host}:${DISPLAY#*:}"
else
export DISPLAY="$4"
host=""
unixs=""
unixf=""
tcpip="${DISPLAY}"
fi
shift 4
xauth -qif <(exec cat 0<&4) extract >(exec xauth -q merge -) \
${unixs:+"$unixs"} \
${unixf:+"$unixf"} \
${tcpip:+"$tcpip"}
exec 4<&-
unset unixs unixf tcpip host || true
exec -a $arg0 $SHELL ${1+"$@"}
exit 1
fi
#
# Active part
#
if test -z "$DISPLAY" ; then
echo "${0##*/}: Missing DISPLAY variable" 1>&2
exit 1
fi
user=root
login=
command=
while test -z "${1%%-*}" -a -n "$1" ; do
if test ${#1} -eq 2 -a -n "${2%%-*}" -a "$1" != "-l" ; then
y="${1#-}${2}"; shift 2
else
y="${1#-}" ; shift 1
fi
case "$y" in
c*) command="${y#?}" ;;
s*) shell="${y#?}" ;;
l|"") login=- ;;
*)
echo "Usage: sux [-c command] [-s shell] [-|-l] [[user]
args]" 1>&2
exit 1
esac
done
if test -n "$1" ; then
user=$1
shift
fi
id=$(id -u $user)
OIFS="$IFS"; IFS=":"
if type -p ypwhich &> /dev/null && test -n "$(ypwhich 2>/dev/null)"
; then
pwline=($((cat /etc/passwd; ypcat passwd)| grep "^${user}:" |
head -1))
else
pwline=($(cat /etc/passwd | grep "^${user}:"))
fi
IFS="$OIFS"
if test -n "$shell" && grep -q $shell /etc/shells &> /dev/null ;
then
shell=$shell
else
shell="${pwline[6]}"
fi
if test -n "${DISPLAY%:*}" ; then
host="${DISPLAY%:*}"
else
host="$(hostname -f)"
fi
tcpip="${host}:${DISPLAY#*:}"
unset host
exec 4< ${XAUTHORITY:-$HOME/.Xauthority}
# Get rid of NFS ;^)
cat ${XAUTHORITY:-$HOME/.Xauthority} > /dev/null
exec -a su /bin/su -s /bin/bash $login -- $user \
$0 +$id "$login" "$shell" "$tcpip" ${command:+-c "$command"}
exit 1
#
# /usr/X11R6/bin/sux ends here
#
--
Hendrik Vogelsang aka Henne
mailto: mickey@naturalbornkiller.de
Recycling and speed limits are bullshit,
they're like someone who quits smoking on his deathbed.
# figth club sigs made with fortune