]> arthur.barton.de Git - ConfigScripts.git/blobdiff - sys/profile
Move Xauthority file to local storage, so that sudo et all work
[ConfigScripts.git] / sys / profile
index ef07918d2ae1041c2ee687b30004e4de288991e0..8b80cf9cc07aa92248e0f17c834b8835d8f87c07 100644 (file)
@@ -72,6 +72,13 @@ export UID USER
 ME=`hostname -s`
 export ME
 
+# Move Xauthority file to local storage, so that sudo et all work
+if [ -z "$XAUTHORITY" -a -r ~/.Xauthority ]; then
+       cp ~/.Xauthority /tmp/Xauthority-$USER
+       chmod 600 /tmp/Xauthority-$USER
+       export XAUTHORITY="/tmp/Xauthority-$USER"
+fi
+
 # read profile additions
 if [ -d /etc/profile.d ]; then
        for f in /etc/profile.d/*; do