<div dir="ltr"><div>The suggestion below, that the core issue is that "su" is leaking the user-space env variables into the root shell, where they are then used to clobber the user-space, seems like a good root-cause analysis of the bug.  I agree, it seems like "su" needs to be fixed.</div><div><br></div><div>I the meanwhile, can we get a work-around? There are 8 bugs duped to this one in Debian; there are several dupes in redhat: <a href="https://bugzilla.redhat.com/show_bug.cgi?id=753882">https://bugzilla.redhat.com/show_bug.cgi?id=753882</a> as well as Linux Mint: <a href="https://github.com/mate-desktop/mate-settings-daemon/issues/44">https://github.com/mate-desktop/mate-settings-daemon/issues/44</a>  and dozens of help forums discuss this.</div><div><br></div><div>This has been biting untold zillions of people for 3-4-5 years now, and the fix-process is stalled due to finger-pointing.  Yes, the right fix seems to be to fix "su", but in the meanwhile... something? </div><div><br></div><div>The current Linux Mint work-around is here: <a href="https://github.com/linuxmint/systemd-betsy/commit/f7ab85f1e1169ac1598dfc1fba1c01063840b3c5">https://github.com/linuxmint/systemd-betsy/commit/f7ab85f1e1169ac1598dfc1fba1c01063840b3c5</a></div><div><br></div><div>--linas</div><div><br></div><div>Am 10.06.2016 um 16:03 schrieb Martin Pitt:</div><div>> Control: tag -1 -moreinfo -unreproducible +wontfix</div><div>> </div><div>> Vlad Orlov [2016-04-20 17:00 +0300]:</div><div>>> You can check [1] to get some info about libpam-systemd doing</div><div>>> something wrong here.</div><div>>> [1] <a href="https://bugzilla.redhat.com/show_bug.cgi?id=753882">https://bugzilla.redhat.com/show_bug.cgi?id=753882</a></div><div>> </div><div>> This was fixed up to the extent possible in</div><div>> <a href="https://github.com/systemd/systemd/commit/baae0358f">https://github.com/systemd/systemd/commit/baae0358f</a>, i. e. 2.5 years</div><div>> ago.</div><div>> </div><div>>> Also we had this issue for months in Linux Mint before Clement Lefebvre</div><div>>> made a patch [2] that fixed it. After the patched libpam-systemd had been</div><div>>> released for Mint, the problem was gone. That was it. No patching gksu,</div><div>>> no patching dconf.</div><div>> </div><div>> That's a very optimistic. Sure, we could (partially) clean up after</div><div>> su's brokenness forever, but (1) this makes the fundamental problem</div><div>> only a bit smaller, but not go away, and (2) we would then have to</div><div>> maintain this wrong patch forever and taking the blame for it instead</div><div>> of fixing it at the root cause.</div><div>> </div><div>> The problem is not "gone" in any sense of the word -- which of the</div><div>> leaked environment variables do you want libpam-systemd to unset in</div><div>> su's stead? XDG_RUNTIME_DIR? DBUS_SESSION_BUS_ADDRESS?</div><div>> DESKTOP_SESSION? MAIL? XDG_CONFIG_DIRS? SSH_AUTH_SOCK? GPG_AGENT_INFO?</div><div>> </div><div>> The fundamental problem is that it's not at all defined what "su"</div><div>> without -l actually wants to be: Switching to a different user like a</div><div>> suid program? Then you need the *entire* environment and not change a</div><div>> few selected variables like $HOME only. Or be like "login"? Then you</div><div>> need to clean the env like su -l or sudo. Both of the latter have</div><div>> well-defined behaviour, whereas the current "su" has no conceptual or</div><div>> consistent (or safe) behaviour at all.</div><div>> </div><div>>> Ok, so maybe it's time to remove 'moreinfo' and 'unreproducible' tags?</div><div>> </div><div>> Yes, I agree about that. But libpam-systemd is still neither the</div><div>> correct nor even a possible place to fix this.</div><div>> </div><div>> AFAICS, the behaviour of "su" without -l either needs to be properly</div><div>> defined and fixed, or it should be completely deprecated, perhaps</div><div>> making it do the same thing as -l.</div><div>> </div><div>> Thanks,</div><div>> </div><div>> Martin</div><div>> </div><div><br></div></div>