Bug#1029557: debian-edu-config: Session exits on first login on roaming-workstation fails

2023-01-24 Thread Mike Gabriel

Hi Petter,

On  Di 24 Jan 2023 15:19:15 CET, Petter Reinholdtsen wrote:


[Nico Winkelsträter]

When a user tries to log in at a romaing workstation for the very first time
the login prompt disappears, stays on the empty default-background for a few
seconds and the returns to lightdm with a brief black-screen.

On the second try everything works as expected.


This is by design.  There was (and probably still is) no way to change
$HOME from the PAM subsystem when the login already was in progress.  To
work around this limitiation the user is logged logged out on the first
try, after the home directory is created and /etc/passwd is updated with
the new home location, to ensure the new home directory is used during
future logins.  The home directory is changed from
/skole/tjener/home0/testes/ to /home/testes/ in your case.


the interesting bit of information is: when using GDM3, the first  
login succeeds and the session is in an intact state.


So, the follow-up question is: Why can this work in GDM3 while it  
fails in LightDM?


Mike
--

DAS-NETZWERKTEAM
c\o Technik- und Ökologiezentrum Eckernförde
Mike Gabriel, Marienthaler Str. 17, 24340 Eckernförde
mobile: +49 (1520) 1976 148
landline: +49 (4351) 850 8940

GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22  0782 9AF4 6B30 2577 1B31
mail: mike.gabr...@das-netzwerkteam.de, http://das-netzwerkteam.de



pgpMoweAJWKuv.pgp
Description: Digitale PGP-Signatur


Bug#1029557: debian-edu-config: Session exits on first login on roaming-workstation fails

2023-01-24 Thread Mike Gabriel

Hi again,

On  Di 24 Jan 2023 15:19:15 CET, Petter Reinholdtsen wrote:


[Nico Winkelsträter]

When a user tries to log in at a romaing workstation for the very first time
the login prompt disappears, stays on the empty default-background for a few
seconds and the returns to lightdm with a brief black-screen.

On the second try everything works as expected.


This is by design.  There was (and probably still is) no way to change
$HOME from the PAM subsystem when the login already was in progress.  To
work around this limitiation the user is logged logged out on the first
try, after the home directory is created and /etc/passwd is updated with
the new home location, to ensure the new home directory is used during
future logins.  The home directory is changed from
/skole/tjener/home0/testes/ to /home/testes/ in your case.



please also note, that we recently changed stuff in libpam-python.so  
and also fixed a pam_session related bug in unit tests. I still need  
to test the Python3 port of libpam-python.so containing this fix (it's  
in Debian testing already) to see if above issue reported by Nico is  
possibly resolved.


Mike
--

DAS-NETZWERKTEAM
c\o Technik- und Ökologiezentrum Eckernförde
Mike Gabriel, Marienthaler Str. 17, 24340 Eckernförde
mobile: +49 (1520) 1976 148
landline: +49 (4351) 850 8940

GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22  0782 9AF4 6B30 2577 1B31
mail: mike.gabr...@das-netzwerkteam.de, http://das-netzwerkteam.de



pgpO8BHmuGlLb.pgp
Description: Digitale PGP-Signatur


Bug#1029557: debian-edu-config: Session exits on first login on roaming-workstation fails

2023-01-24 Thread Petter Reinholdtsen
[Nico Winkelsträter]
> When a user tries to log in at a romaing workstation for the very first time
> the login prompt disappears, stays on the empty default-background for a few
> seconds and the returns to lightdm with a brief black-screen.
>
> On the second try everything works as expected.

This is by design.  There was (and probably still is) no way to change
$HOME from the PAM subsystem when the login already was in progress.  To
work around this limitiation the user is logged logged out on the first
try, after the home directory is created and /etc/passwd is updated with
the new home location, to ensure the new home directory is used during
future logins.  The home directory is changed from
/skole/tjener/home0/testes/ to /home/testes/ in your case.

-- 
Happy hacking
Petter Reinholdtsen



Bug#1029557: debian-edu-config: Session exits on first login on roaming-workstation fails

2023-01-24 Thread Nico Winkelsträter

Package: debian-edu-config
Version: 2.11.56+deb11u4
Severity: normal

Dear Maintainer,

When a user tries to log in at a romaing workstation for the very first time
the login prompt disappears, stays on the empty default-background for a few
seconds and the returns to lightdm with a brief black-screen.

On the second try everything works as expected.


I suspect that pam_mklocaluser does not properly initialize the environment
because the logs show some errors from pulseaudio as well as lightdm 
trying to

write to the wrong home directory:

Jan 24 14:08:38 am-5254007fbccd.intern pulseaudio[5100]: Failed to create
secure directory (/skole/tjener/home0/teste
s/.config/pulse): Datei oder Verzeichnis nicht gefunden

Jan 24 14:08:47 am-5254007fbccd.intern lightdm[5053]: Error writing X
authority: Failed to open X authority 
/skole/tjener/home0/testes/.Xauthority:

No such file or directory


This occurs on a debian-edu deployment which has been in use for about a 
year

and I could also reproduce this behavior locally on a fresh install with one
mainserver VM an one romaing-workstation VM.

Regards
Nico Winkelsträter


--
Mit freundlichen Grüßen

Nico Winkelsträter
Trainee Administrator

initOS GmbH
Innungsstraße 7
21244 Buchholz i.d.N.

Phone:   +49 4105 56156-33
Fax: +49 4105 56156-10

Email:   nico.winkelstrae...@initos.com
Web: http://www.initos.com

Geschäftsführung:
Dr.-Ing. Frederik Kramer & Dipl.-Ing. (FH) Torsten Francke

Sitz der Gesellschaft: Rosengarten – Klecken
Amtsgericht Tostedt, HRB 205226
Steuer-Nr: 15/200/53247
USt-IdNr: DE815580155Jan 24 14:08:37 am-5254007fbccd.intern lightdm[5053]: pam_sss(lightdm:auth): authentication success; logname= uid=0 euid=0 tty=:0 ruser= rhost= user=testes
Jan 24 14:08:37 am-5254007fbccd.intern lightdm[5053]: gkr-pam: unable to locate daemon control file
Jan 24 14:08:37 am-5254007fbccd.intern lightdm[5053]: gkr-pam: stashed password to try later in open session
Jan 24 14:08:37 am-5254007fbccd.intern lightdm[5053]: Error getting user list from org.freedesktop.Accounts: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Accounts was not provided by any .service files
Jan 24 14:08:37 am-5254007fbccd.intern lightdm[608]: g_dbus_connection_call_sync_internal: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
Jan 24 14:08:37 am-5254007fbccd.intern lightdm[608]: g_dbus_connection_call_sync_internal: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
Jan 24 14:08:37 am-5254007fbccd.intern systemd[1]: Stopping Session c8 of user lightdm.
Jan 24 14:08:37 am-5254007fbccd.intern lightdm[4969]: pam_unix(lightdm-greeter:session): session closed for user lightdm
Jan 24 14:08:37 am-5254007fbccd.intern systemd[1]: session-c8.scope: Succeeded.
Jan 24 14:08:37 am-5254007fbccd.intern systemd[1]: Stopped Session c8 of user lightdm.
Jan 24 14:08:37 am-5254007fbccd.intern systemd-logind[603]: Removed session c8.
Jan 24 14:08:37 am-5254007fbccd.intern lightdm[5053]: pam_unix(lightdm:session): session opened for user testes(uid=1007) by (uid=0)
Jan 24 14:08:37 am-5254007fbccd.intern systemd[1]: Created slice User Slice of UID 1007.
Jan 24 14:08:37 am-5254007fbccd.intern systemd[1]: Starting User Runtime Directory /run/user/1007...
Jan 24 14:08:37 am-5254007fbccd.intern pulseaudio[4990]: Unable to set sw params: Keine Berechtigung
Jan 24 14:08:37 am-5254007fbccd.intern pulseaudio[4990]: Failed to set software parameters: Keine Berechtigung
Jan 24 14:08:37 am-5254007fbccd.intern pulseaudio[4990]: Error opening PCM device front:0: Datei oder Verzeichnis nicht gefunden
Jan 24 14:08:37 am-5254007fbccd.intern systemd-logind[603]: New session 40 of user testes.
Jan 24 14:08:37 am-5254007fbccd.intern systemd[4973]: pulseaudio.service: Succeeded.
Jan 24 14:08:37 am-5254007fbccd.intern systemd[1]: Finished User Runtime Directory /run/user/1007.
Jan 24 14:08:37 am-5254007fbccd.intern systemd[1]: Starting User Manager for UID 1007...
Jan 24 14:08:37 am-5254007fbccd.intern systemd[5060]: pam_unix(systemd-user:session): session opened for user testes(uid=1007) by (uid=0)
Jan 24 14:08:37 am-5254007fbccd.intern systemd[5060]: Queued start job for default target Main User Target.
Jan 24 14:08:37 am-5254007fbccd.intern systemd[5060]: Created slice User Application Slice.
Jan 24 14:08:37 am-5254007fbccd.intern systemd[5060]: Reached target Paths.
Jan 24 14:08:37 am-5254007fbccd.intern systemd[5060]: Reached target Timers.
Jan 24 14:08:37 am-5254007fbccd.intern systemd[5060]: Starting D-Bus User Message Bus Socket.
Jan 24 14:08:37 am-5254007fbccd.intern systemd[5060]: Listening on GnuPG network certificate management daemon.
Jan 24 14:08:37 am-5254007fbccd.intern systemd[5060]: Listening on GnuPG cryptographic agent and passphrase cache (access for web browsers).
Jan 24 14:08:37 am-5254007fbccd.intern systemd[5060]: Listening on GnuPG cryptographic agent and passphrase cache (restricted).
Jan 24 14:08:37 am-5254007fbccd.intern systemd[5060]: Listening on GnuPG