]> git.ipfire.org Git - thirdparty/systemd.git/commit
homed: introduce "area" concept (i.e. secondary home directories stored below the...
authorLennart Poettering <lennart@poettering.net>
Thu, 6 Feb 2025 11:47:04 +0000 (12:47 +0100)
committerGitHub <noreply@github.com>
Thu, 6 Feb 2025 11:47:04 +0000 (12:47 +0100)
commit240f2d5b5cffbb5048536623bf7b516d3532c329
treea8487a23df9659115dabafc788ed4449fef8f08f
parent229d91793f653ba41b4f80c2466b614cd5745443
parent8954a2a833c015b28bc9a63b0be55ff493a4f5d6
homed: introduce "area" concept (i.e. secondary home directories stored below the primary one, of which one can pick one at login) (#36149)

This adds a new concept to homed/pam_systemd/pam_systemd_homed: "areas"
are secondary home dirs you can have inside your primary home dir, below
an `~/Areas/` hierarchy. You can log into these secondary dirs if you
specify "user%area" as user at login time.

This is quite useful for maintaining multiple sets of user resources
within the same user account with the same access privileges. The
intended usecase for me is utimately WSL-like stuff: you start a local
unpriv container which gets the host's home dir mounted in and fully
accessible, without this also meaning that the user account gets the
full set of settings and so on propagated down.

Codewise the concept is really simple: whenever an area name like
"foobar" is specified we simply change a $HOME of /home/lennart into
/home/lennart/Areas/foobar. In a way this PR adds more docs than code
for all this.

This also makes this feature directly accessible via "run0 -a foobar"
(for opening a new session in the 'foobar' area).

To be truly fun to use on text (i.e. getty) logins, a util-linux version
containing https://github.com/util-linux/util-linux/pull/3354 is best,
since otherwise $HOME is updated to /home/lennart/Areas/foobar, but the
cwd is still at /home/lennart.