Skip to content

Match FamilyWild Xauthority entries in get_best_auth - #296

Open
barlowa124 wants to merge 1 commit into
python-xlib:masterfrom
barlowa124:xauth-familywild-294
Open

barlowa124 wants to merge 1 commit into
python-xlib:masterfrom
barlowa124:xauth-familywild-294

Conversation

@barlowa124

Copy link
Copy Markdown

Summary

Fixes #294.

XWayland setups (via Mutter) write FamilyWild (0xffff) Xauthority
entries whose display-number field is empty. get_best_auth compared the
entry family to the requested family exactly, so a FamilyWild entry could
never match, and new_get_auth returned no credentials for :0 even when
a valid cookie was present.

xauth.py now mirrors the matching rule in libXau's
XauGetBestAuthByAddr. A FamilyWild entry matches any family and address.
An entry with an empty display number still matches any display number, as
before.

New tests in test/test_xauth.py cover a wild entry under FamilyLocal
and FamilyInternet lookups. The exact-match path and XNoAuthError for
non-wild mismatches are covered too. The suite's display-dependent tests
still need a real X server, so they do not run here. The non-display ones
are clean.

AI-assisted (Devin).

XWayland (via Mutter) writes FamilyWild (0xffff) entries with an empty
display-number field, intended to match any family, address and display.
get_best_auth compared family exactly, so such entries never matched and
new_get_auth returned no credentials for :0 despite a valid cookie.

Mirror libXau's XauGetBestAuthByAddr: a FamilyWild entry matches any
family and address, and an empty entry number matches any display number.

Fixes python-xlib#294
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

new_get_auth() fails to authenticate against Xauthority entries with an empty display number under Wayland/XWayland

1 participant