ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.26k stars 174 forks source link

Steam uses wrong host name if changed in the same session #8208

Open SethFalco opened 3 years ago

SethFalco commented 3 years ago

Your system information

Please describe your issue in as much detail as possible:

If one changes their host name via sudo hostnamectl set-hostname {{new_hostname}} and then goes to install and run Steam without restarting, Steam fails to launch properly.

Steam will take 5-10 minutes to launch, and if the GUI does manage to appear, it will fail to respond anyway.

Steps for reproducing this issue:

  1. Turn on the PC and ensure Steam is closed.
  2. Do sudo hostnamectl set-hostname {{something}} to change the hosts name.
  3. Try to launch Steam.
Specs: Part Value
Display 3k 16:10 90Hz
CPU Intel Core i7-11370H
iGPU Iris Xe Graphics G7
Memory 64 GB 3200MHz
Storage 1 TB Samsung 980 Pro

Logs

Notice how my host name is seth-pc-tux, but Steam "cannot connect to non-local host" seth-pc which was the old name.

seth@seth-pc-tux:~$ steam
…
_IceTransSocketUNIXConnect: Cannot connect to non-local host seth-pc
_IceTransSocketUNIXConnect: Cannot connect to non-local host seth-pc
Could not connect to X session manager: Could not open network socket
Installing breakpad exception handler for appid(steam)/version(1634158817)
Installing breakpad exception handler for appid(steam)/version(1634158817)
Installing breakpad exception handler for appid(steam)/version(1634158817)
Installing breakpad exception handler for appid(steam)/version(1634158817)
Installing breakpad exception handler for appid(steam)/version(1634158817)
Installing breakpad exception handler for appid(steam)/version(1634158817)
Installing breakpad exception handler for appid(steam)/version(1634158817)
Installing breakpad exception handler for appid(steam)/version(1634158817)
Installing breakpad exception handler for appid(steam)/version(1634158817)
CAppInfoCacheReadFromDiskThread took 57 milliseconds to initialize
Installing breakpad exception handler for appid(steam)/version(1634158817)
Installing breakpad exception handler for appid(steam)/version(1634158817)
Installing breakpad exception handler for appid(steam)/version(1634158817)
Installing breakpad exception handler for appid(steam)/version(1634158817)
Installing breakpad exception handler for appid(steam)/version(1634158817)
Proceed to auto login
Installing breakpad exception handler for appid(steam)/version(1634158817)
Installing breakpad exception handler for appid(steam)/version(1634158817)
Opted-in Controller Mask for AppId 0: 0
_IceTransSocketUNIXConnect: Cannot connect to non-local host seth-pc
_IceTransSocketUNIXConnect: Cannot connect to non-local host seth-pc
Could not connect to X session manager: Could not open network socket
_IceTransSocketUNIXConnect: Cannot connect to non-local host seth-pc
_IceTransSocketUNIXConnect: Cannot connect to non-local host seth-pc
Could not connect to X session manager: Could not open network socket
MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0

(steam:72115): Gtk-WARNING **: gtk_disable_setlocale() must be called before gtk_init()
MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0

Installing breakpad exception handler for appid(steam)/version(1634158817)
Installing breakpad exception handler for appid(steam)/version(1634158817)
BuildCompleteAppOverviewChange: 0
roaming config store loaded successfully - 164 bytes.
migrating temporary roaming config store
BRefreshApplicationsInLibrary 1: 12ms
_IceTransSocketUNIXConnect: Cannot connect to non-local host seth-pc
_IceTransSocketUNIXConnect: Cannot connect to non-local host seth-pc
…

Workaround

Restarting the PC resolves the issue.

smcv commented 3 years ago

Unfortunately, X11 authentication via XAUTHORITY (typically using ~/.Xauthority) relies on the hostname remaining the same: entries in the Xauthority file are keyed by the hostname. This is not Steam's design decision, it's a lower-level thing.

Some X11 display managers, such as GNOME's gdm, configure the X11 display to accept any connection from the same uid using the equivalent of the command xhost +si:localuser:$(id -un), but some display managers don't do that. That command might work around this.

In principle Steam could do that itself, but I think it would be inappropriate for Steam to be altering your security policy, particularly in order to work around a rare issue.