From 7b7dced5819ad3d1e6aca1dc7c83a80c2959fb56 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Mon, 5 Jan 2009 16:59:03 +0100 Subject: [PATCH] Move .Xauthority to /tmp and export $XAUTHORITY 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/user/bash_profile b/user/bash_profile index 85bf8de..9d237dd 100644 --- a/user/bash_profile +++ b/user/bash_profile @@ -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 -- 2.39.2