Skip to content

Draft: UNIX sockets: Don't unlink an existing socket before binding a new one

Olivier Certner requested to merge OlCe/libxtrans:issue-4 into master

Running the X server as root makes the unlink operation always succeed, as well as the subsequent socket binding (socket creation in the file system). But success in binding a new socket is used to detect in-use displays when specifying "-displayfd". So, when running as root, :0 is never detected as been used and its socket is systematically crushed, rendering the existing :0 session stale.

Moreover, sockets are cleaned up by the X server, even in case of abnormal termination.

For issue #4.

If you find this change too drastic, I may instead be able to fix the problem in the server directly, see related issue xorg/xserver#1139.

Edited by Olivier Certner

Merge request reports

Loading