-
Notifications
You must be signed in to change notification settings - Fork 152
Description
Description:
Currently, dynamic seats (e.g. XDMCP and VNC) fail to match configuration sections like [Seat:xdmcp*] or [Seat:vnc*]. This is because set_seat_properties() is called with a NULL name parameter during session initialization, forcing a fallback to the global [Seat:*] properties regardless of the actual seat name.
https://github.com/canonical/lightdm/blob/5f14752419fc7f0fd763013c8195dcb0099c940a/src/lightdm.c#L205-L209
https://github.com/canonical/lightdm/blob/5f14752419fc7f0fd763013c8195dcb0099c940a/src/lightdm.c#L266-L274
https://github.com/canonical/lightdm/blob/5f14752419fc7f0fd763013c8195dcb0099c940a/src/lightdm.c#L279-L287
https://github.com/canonical/lightdm/blob/5f14752419fc7f0fd763013c8195dcb0099c940a/src/lightdm.c#L905-L919
Impact:
This prevents users from defining seat-specific properties for remote seats (e.g., type=xremote) without globally overriding the defaults, which is increasingly problematic in Wayland-default environments like Raspberry Pi OS.
Proposed Change:
Eliminate the second parameter of set_seat_properties() and extract the seat name internally, or update all call sites to explicitly pass the seat name and ensure that NULL is never passed as the seat_name argument.
Comments:
I spent hours trying to understand why a section like [Seat:xdmcp*] or [Seat:xdmcp0] in my config file failed to match the xdmcp0 seat. I finally found the source code and discovered that the seat name isn’t passed to set_seat_properties(), so we only get the configuration from [Seat:*] for xdmcp seats.
This seems like a bug because it prevents specifying xdmcp-specific properties in the seat configuration, and the current behavior isn’t documented. The comments in the config file suggest that a section name like [Seat:xdmcp*] should work.
From the source code, it appears that VNC connections and the default seat also have this problem. I don’t see any current use cases for set_seat_properties() where a string other than the seat name should be passed in the second parameter. As long as that is the case, allowing the seat name to be passed in explicitly as an argument seems to be more of a hazard than a benefit. If it were up to me, I'd eliminate the parameter until there is a real use case for it.