https://bugs.kde.org/show_bug.cgi?id=527191

--- Comment #2 from N. Can KIRIK <[email protected]> ---
Environment
-----------
- KDE neon (Ubuntu 24.04 base), systemd 255, kernel 7.0.0-38
- plasmalogin 6.8.0 (build26), krdp 6.8.0 (build57), Plasma/KWin 6.8.0, Wayland
session
- NVIDIA GPU (krdp falls back to software x264 encoding - not related to this
bug)
- /etc/plasmalogin.conf:

      [Autologin]
      Relogin=true
      Session=plasma.desktop
      User=can

- krdpserverrc: SystemUserEnabled=true, ExclusiveMode=true; server enabled with
  "autostart at login".

Steps to reproduce
------------------
1. Configure autologin with Relogin=true (legitimate setup so that a logout
returns to a
   locked session instead of parking at the greeter).
2. Enable the RDP server in unattended mode (ExclusiveMode=true) with
autostart.
3. Reboot; the session autologins, then locks.
4. Connect with an RDP client (here: aRDP on Android; my client connected twice
- a retry
   - but the first connection alone already spawns the first duplicate
session).

Expected result
---------------
The physical outputs show the greeter/login screen while the remote client
works (per krdp
MR !230: "The host PC is send to the login screen. The session is re-locked on
exit.").
No new sessions are created and the session is re-locked on disconnect.

Actual result
-------------
Every SwitchToGreeter request adds a display and performs a
pam_unix(*plasmalogin-autologin*)
login, creating a duplicate session:

    12:41:38 krdpserver[1708]: New client connected:  Unspecified platform
Unspecified version
    12:41:38 plasmalogin[1258]: Adding new display...
    12:41:38 plasmalogin[1258]: tty "tty1" already in use by "" "active" ""
"KDE" 1
    12:41:38 plasmalogin[1258]: Using VT 2
    12:41:38 plasmalogin[1258]: start auth user true
"/usr/lib/x86_64-linux-gnu/libexec/plasma-dbus-run-session-if-needed
/usr/bin/startplasma-wayland"
    12:41:38 krdpserver[1708]: Switched to greeter successfully.
    12:41:38 plasmalogin[1258]: Authentication for user  "can"  successful
    12:41:38 plasmalogin-helper[25415]:
pam_unix(plasmalogin-autologin:session): session opened for user can(uid=1000)
by can(uid=0)
    12:41:38 systemd-logind[970]: New session 93 of user can.

The client's second connection:

    12:41:41 plasmalogin[1258]: Adding new display...
    12:41:41 plasmalogin[1258]: Using VT 3
    12:41:41 krdpserver[1708]: Switched to greeter successfully.
    12:41:41 plasmalogin[1258]: Authentication for user  "can"  successful
    12:41:41 systemd-logind[970]: New session 94 of user can.
    12:41:41 plasmalogin[1258]: Auth: plasmalogin-helper exited with 64
    12:41:41 systemd-logind[970]: Removed session 93.

The original session (VT 1) keeps running - audio playback continues - but
loses DRM
master and KWin starts failing there:

    12:41:38 kwin_wayland[1559]: Invalid framebuffer status: 
"GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT"
    12:41:38 kwin_wayland[1559]: Atomic commit failed: EACCESS

ksplashqml in the duplicate sessions crashed (coredumps at 12:41:39 and
12:41:42). The
physical screen stayed frozen on the duplicate session and the physical
keyboard/mouse
were unresponsive; I had to reboot via Ctrl+Alt+Del. The remote client itself
kept
working the whole time (it streams the original session on a krdp virtual
monitor).

On disconnect, the seat is never restored and the re-lock fails:

    12:43:18 systemd[1]: Activating special unit reboot.target...
    (the reboot is my forced reboot)
    12:43:18 krdpserver[1708]:  12:43:18 | INFO | Disconnected by EIS
    12:43:18 krdpserver[1708]: There are no outputs - creating placeholder
screen
    12:43:18 krdpserver[1708]: krdp: could not lock the logind session:
"Unknown object '/org/freedesktop/login1/session/auto'."

(The lock error raced with system teardown after the forced reboot, so it may
be
incidental.)

Full journal excerpt attached.

Notes
-----
- Setting Relogin=false avoids this specific cascade (the autologin condition
  (autologinRelogin() || tryLockFirstLogin()) no longer fires for displays
added after the
  first login), but Relogin=true is a legitimate configuration, and an explicit
  SwitchToGreeter request should always produce a greeter.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to