Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple XDMCP connections from same /8 subnet overwrite utmp entries #360

Open
acarapetis opened this issue Jun 7, 2024 · 0 comments
Open

Comments

@acarapetis
Copy link

acarapetis commented Jun 7, 2024

When multiple clients connect over XDMCP from the same host, only one entry appears in utmp.

For example, if I connect a new client from localhost using Xephyr -query localhost :2, then who shows me the login as I expect:

anthony               2024-06-07 09:59 (172.18.64.3:2) # first XDMCP session
anthony               2024-06-07 09:31 (:1) # my local session

But if I then start another simultaneous session with Xephyr -query localhost :3, it seems the :2 session in utmp is overwritten with the :3 session:

anthony               2024-06-07 10:01 (172.18.64.3:3)
anthony               2024-06-07 09:31 (:1)

I believe the cause is that ut_id is being set as the first four characters of xdisplay, which for XDMCP connections is a string of the form {ip}:{display}; so any client connecting from the 172/8 subnet will get the ID "172.". Thus pututxline thinks we're trying to update an existing entry, not add a new one.
https://github.com/canonical/lightdm/blob/main/src/session-child.c#L739-L740

See this near-identical issue in gdm3, which looks like it was fixed by just not setting ut_id at all: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=690197

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

No branches or pull requests

1 participant