Skip to content

Commit

Permalink
fixes for XAUTHORITY check #81
Browse files Browse the repository at this point in the history
  • Loading branch information
mviereck committed Oct 18, 2018
1 parent 80bc1f3 commit d09cbd4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions x11docker
Original file line number Diff line number Diff line change
Expand Up @@ -5048,15 +5048,17 @@ check_hostxenv() { # check environment variables for host X display
}

# get cookie from host display
Hostxauthority=${XAUTHORITY:-}
[ -z "$Hostxauthority" ] && Hostxauthority="$(systemctl --user show-environment | grep XAUTHORITY= | cut -d= -f2)"
[ -z "$Hostxauthority" ] && [ -e "$Hostuserhome/.Xauthority" ] && Hostxauthority="$Hostuserhome/.Xauthority"
XAUTHORITY=${XAUTHORITY:-}
[ -z "$XAUTHORITY" ] && XAUTHORITY="$(systemctl --user show-environment | grep XAUTHORITY= | cut -d= -f2)"
[ -z "$XAUTHORITY" ] && [ -e "$Hostuserhome/.Xauthority" ] && XAUTHORITY="$Hostuserhome/.Xauthority"
[ "${XAUTHORITY:-}" ] && {
$Mksu "$Xauthexe -i -f ${XAUTHORITY:-} nlist $Hostdisplay 2>/dev/null | rmcr | $Xauthexe -f $Hostxauthority nmerge - 2>/dev/null"
chown $Hostuser $Hostxauthority
chmod 600 $Hostxauthority
export XAUTHORITY
} || {
Hostxauthority=""
unset XAUTHORITY
}
[ "$Hostdisplay" ] || {
Hostxsocket=""
Expand Down

0 comments on commit d09cbd4

Please sign in to comment.