fix: handle absolute WAYLAND_DISPLAY in -d desktop binding#13
Open
netpleb wants to merge 1 commit into
Open
Conversation
WAYLAND_DISPLAY and XAUTHORITY may each be either a bare name (resolved relative to XDG_RUNTIME_DIR and $HOME respectively) or an absolute path. The old code always prepended the base directory, so an absolute value produced a malformed path like /run/user/1001//run/user/1000/wayland-0 or /home/alice//run/user/1000/.mutter-Xwaylandauth.XXXXXX, causing a bwrap "Can't find source path" error and breaking -d desktop access. Detect the absolute form for both and use it as-is, otherwise resolve relative to the base as before. Guard each bind with an existence check so a stale/missing socket or auth file is skipped instead of crashing bwrap. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
335de9d to
1d34fdb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WAYLAND_DISPLAY may be an absolute path, in which case XDG_RUNTIME_DIR must not be prepended. The old code always concatenated them, producing a malformed path like /run/user/1001//run/user/1000/wayland-0 and a bwrap "Can't find source path" error. Detect the absolute form, use it as-is, and guard the bind with an existence check.