Skip to content

Commit

Permalink
--hostdisplay: allow missing xauth if host X has no cookie, too. #219
Browse files Browse the repository at this point in the history
  • Loading branch information
mviereck committed Feb 18, 2020
1 parent 53d25cc commit 282a526
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions x11docker
Original file line number Diff line number Diff line change
Expand Up @@ -6056,9 +6056,6 @@ check_host() { # check host environment
[ "${0:-}" = "${BASH_SOURCE:-}" ] && Runssourced="no" || Runssourced="yes"

Hostsystem="$(grep '^ID=' /etc/os-release 2>/dev/null | cut -d= -f2 || echo 'unknown')"

# Check if docker is installed with Ubuntu snap
myrealpath "$(command -v docker)" | grep -q snap && Runsinsnap="yes" || Runsinsnap="no"

# Check libc from host. If same as in container, it is possible to share timezone file
Hostlibc="unknown"
Expand Down Expand Up @@ -6128,6 +6125,9 @@ check_host() { # check host environment
;;
esac

# Check if docker is installed with snap/snappy
myrealpath "$(command -v "${Dockerexe:-docker_not_found}")" | grep -q snap && Runsinsnap="yes" || Runsinsnap="no"

# Provide dos->unix newline converter to unpriv() commands
export -f rmcr

Expand Down Expand Up @@ -6315,6 +6315,7 @@ check_hostxenv() { # check environment variables for host X display
return 0
}
check_option_interferences() { # check multiple option interferences, change settings if needed
local Message

[ "$Desktopmode" = "no" ] && case $Xserver in
--xephyr|--weston-xwayland|--kwin-xwayland|--xorg) Windowmanagermode="auto" ;;
Expand Down Expand Up @@ -6428,13 +6429,15 @@ check_option_interferences() { # check multiple option interferences, change se
*)
command -v xauth >/dev/null || {
case $Xoverip in
yes)
error "Command 'xauth' not found.
yes)
[ -z "$Hostxauthority" ] && [ "$Xserver" = "--hostdisplay" ] && Message=warning || Message=error
$Message "Command 'xauth' not found.
SECURITY RISK!
Your X server would be accessable over network without authentication!
That could be abused to take control over your system.
Please install 'xauth' to allow X cookie authentication.
You can disable cookie authentication with discouraged option --no-auth."
Xauthentication="no"
;;
no|"")
warning "Command 'xauth' not found.
Expand Down

0 comments on commit 282a526

Please sign in to comment.