]> arthur.barton.de Git - ConfigScripts.git/commitdiff
Move .Xauthority to /tmp and export $XAUTHORITY
authorAlexander Barton <alex@barton.de>
Mon, 5 Jan 2009 15:59:03 +0000 (16:59 +0100)
committerAlexander Barton <alex@barton.de>
Mon, 5 Jan 2009 15:59:03 +0000 (16:59 +0100)
This solves permission problems when $HOME is located on NFS, sudo is
used, and the root user is not allowed to access the user home directory.

user/bash_profile

index 85bf8de65e0790b505cf251aefa17461e1e8e583..9d237dd7e9f7c7009ddc54bb030b2d7e3777e7a5 100644 (file)
@@ -16,6 +16,12 @@ export CVS_RSH=ssh
 
 [ "$OSTYPE" != "Aux" ] && ulimit -c 2048
 
+if [ -z "$XAUTHORITY" -a -r $HOME/.Xauthority ]; then
+       cp $HOME/.Xauthority /tmp/Xauthority-$USER
+       chmod 600 /tmp/Xauthority-$USER
+       export XAUTHORITY="/tmp/Xauthority-$USER"
+fi
+
 if [ -f ~/.bashrc ]; then
        . ~/.bashrc
 fi