Bugzilla – Bug 1226452
pam-config: Faulty on user systemd services due to encrypted home dir
Last modified: 2024-06-20 09:25:03 UTC
Systemd is triggered before user home directory is unlocked with fscrypt or ecryptfs, which results on errors with some services. To reproduce the issue i'm using fscrypt and onedriver (home:jstaf/packages/onedriver), i've setup to automount my OneDrive storage in a directory inside my home dir. After logging in i get an error about '/etc/mtab' not having the OneDriver entry. Changing the pam.d order in /etc/pam.d/common-session fixes that. Fscrypt README (https://github.com/google/fscrypt?tab=readme-ov-file#enabling-the-pam-module-on-other-linux-distros) advices to call pam_fscrypt.so before pam_systemd.so. The original file is found as: session optional pam_systemd.so session required pam_limits.so session required pam_unix.so try_first_pass session optional pam_umask.so session optional pam_fscrypt.so (...) It should be: session required pam_limits.so session required pam_unix.so try_first_pass session optional pam_umask.so session optional pam_fscrypt.so session optional pam_systemd.so (...) EXPECTED RESULTS: The user home directory must be unlocked before trying to execute any user service. This configuration must be automatically set by pam-config. CURRENT RESULTS: SystemD is triggered to start user services before it's home directory is unlocked, which breaks some programs.
This problem is not solvable, since they have a classical deadlock: pam_systemd needs be be called before pam_krb5 pam_fscrypt needs to be called after pam_unix pam_krb5 and pam_unix setup is so complex that you cannot put pam_systemd somewhere inbetween. So if you don't use kerberos, you have maybe luck and it works if you change it manual. Else: somebody needs to cleanup this dependency mess in the modules, this is nothing pam-config can solve.
I made some changes, let's hope not too much else got broken by this.
This is an autogenerated message for OBS integration: This bug (1226452) was mentioned in https://build.opensuse.org/request/show/1181887 Factory / pam-config