[systemd-devel] Fix PAM module to not clobber XDG_RUNTIME_DIR with su

Martin Pitt martin.pitt at ubuntu.com
Wed Nov 13 22:45:19 PST 2013


Hello all,

pam_systemd currently causes some havoc when you run programs or
shells with su: it passes on the $XDG_RUNTIME_DIR from the original
user session, so that programs like pulseaudio or dconf end up
scribbling into the original user's runtime dir. This has been
discussed at length at [1][2] and is leading people to consider
workarounds like [3].

It seems Lennart is against giving the new user a new logind session
and runtime dir; I think it would be right to give it a fresh (or an
already existing one for the target user) runtime dir, but in either
case passing it the original user's runtime dir is actively wrong and
harmful.

Until then I recommend applying this patch (or something equivalent)
which at least stops destroying existing runtime dirs and makes it
compliant to the spec [4]. With that, things like pulse, dconf, or
dbus will still need to keep their internal fallback if there is no
runtime dir, but that's a less pressing matter.

Thanks for considering,

Martin

[1] https://bugzilla.redhat.com/show_bug.cgi?id=753882
[2] https://launchpad.net/bugs/1197395
[3] http://lists.freedesktop.org/archives/pulseaudio-discuss/2013-November/019121.html
[4] http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-pam-Check-XDG_RUNTIME_DIR-owner.patch
Type: text/x-diff
Size: 2462 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20131114/070a5248/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20131114/070a5248/attachment-0001.pgp>


More information about the systemd-devel mailing list