Skip to content

Fix tty for Wayland sessions - #483

Open
dklima wants to merge 1 commit into
ubuntu:mainfrom
dklima:fix-wayland-tty
Open

dklima wants to merge 1 commit into
ubuntu:mainfrom
dklima:fix-wayland-tty

Conversation

@dklima

@dklima dklima commented Sep 24, 2026 •

Copy link
Copy Markdown

Wayland sessions fail to start. This PR fixes two bugs.

1. Wrong tty path

wayland-session.c makes /dev/tty/N. The correct path is /dev/ttyN. With the wrong path, pam_selinux fails on setfilecon and LightDM can crash.

2. Stale PAM_TTY

LightDM sets PAM_TTY during authentication. For a Wayland greeter, the value is the greeter tty. For an X11 greeter, the value is the greeter X display.

The session can start on a different VT. With a Wayland greeter, pam_systemd then sends the greeter tty with the session XDG_VTNR, and logind returns InvalidParameter.

This change sets PAM_TTY to the session tty before pam_open_session for all sessions that are not X11. This also changes one path that works now: an X11 greeter that starts a Wayland session. PAM_TTY changes from the greeter X display to the session tty. X11 sessions do not change.

Test

Fedora 44, lightdm 1.33.1 with this patch, SELinux enforcing:

  • Wayland greeter (elementary-greeter) to a Wayland session (Pantheon): login works.
  • X11 greeter (slick-greeter) to a Wayland session (Pantheon): login works. logind reports the correct TTY and VTNr.

Fixes #480

Use /dev/ttyN instead of /dev/tty/N as the tty path.

Set PAM_TTY to the session tty before pam_open_session. The session can
run on a different VT than the greeter. A stale PAM_TTY makes logind
reject the session with InvalidParameter.

Fixes ubuntu#480
@garaevdi

Copy link
Copy Markdown

Just tested it, can confirm now it works fine, thanks!

@jpeisach

jpeisach commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

at some point I'll test this locally to confirm and then I'll merge it in, thanks guys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Couldn't login with elementary's greeter

3 participants