Bug 915498 - su transfers XDG_RUNTIME_DIR while it probably shouldn't
su transfers XDG_RUNTIME_DIR while it probably shouldn't
Status: CLOSED DUPLICATE of bug 753882
Product: Fedora
Classification: Fedora
Component: coreutils (Show other bugs)
18
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Ondrej Vasik
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-25 16:58 EST by Kamil Páral
Modified: 2014-11-17 07:33 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-26 12:21:21 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kamil Páral 2013-02-25 16:58:35 EST
Description of problem:
I guess XDG_RUNTIME_DIR should not be transferred when I log in as an another user using "su -". It points to a directory that is relevant to the UID, and of course it is writeable just by the owner.

I see some ugly messages when I try to run an application to uses dconf (gcalctool for example).

> kparal@kraken ~ $ id
> uid=1000(kparal) gid=1000(kparal) groups=1000(kparal),4(adm),10(wheel)
> kparal@kraken ~ $ echo $XDG_RUNTIME_DIR 
> /run/user/1000
> kparal@kraken ~ $ su - gamer
> Password: 
> [gamer@kraken ~]$ id
> uid=1002(gamer) gid=1002(gamer) groups=1002(gamer)
> [gamer@kraken ~]$ echo $XDG_RUNTIME_DIR 
> /run/user/1000
> [gamer@kraken ~]$ gcalctool
> ...
> ** (gcalctool:3674): CRITICAL **: unable to create directory '/run/user/1000/dconf': Permission denied.  dconf will not work properly.
> (lots of these)

Version-Release number of selected component (if applicable):
coreutils-8.17-8.fc18.x86_64

How reproducible:
always
Comment 1 Ondrej Vasik 2013-02-26 04:24:45 EST
For me this is a bit contrary to https://bugzilla.redhat.com/show_bug.cgi?id=912778 ... maybe I don't understand this correctly. Anyway - su moved to util-linux in F19/Rawhide... is it the same way there?
Comment 2 Kamil Páral 2013-02-26 05:35:57 EST
I'm not the expert in these matter, I can't really say what the right behavior should be. But it seems to me very weird to pass by variables that point to a location that can't be accessed. Especially when everything works correctly if you unset that variable.

I tested with util-linux-2.22-6.fc19.x86_64 and the behavior is the same. Should we reassign to Rawhide and util-linux?
Comment 3 Ondrej Vasik 2013-02-26 06:46:35 EST
Karel Zak (util-linux maintainer) is in CC here and this kind of behaviour is AFAIK caused by pam hooks (which is area of Tomas Mraz - not in CC yet). Let's keep it here and wait for Karel's opinion. We may move it or even just not a bug it... Can't say for sure at the moment.
Comment 4 Kamil Páral 2013-02-26 07:03:07 EST
One further note - with sudo there are no XDG variables passed by, just with su.
Comment 5 Adam Tkac 2013-02-26 09:12:24 EST
Bug #912778 talks about login shell but this bug talks about non-login shell (i.e. "su" vs. "su -l"). I wrote proposal how to deal with both bugs on https://bugzilla.redhat.com/show_bug.cgi?id=753882#c35
Comment 6 Kamil Páral 2013-02-26 11:46:21 EST
Adam, I actually talk about login shell as well ("su -"). After reading bug 753882 I think this one can be safely duped to it. It's basically the same problem. But I leave that decision for the more educated ones in this area.
Comment 7 Ondrej Vasik 2013-02-26 12:21:21 EST
Let's go with duplicate, I agree...

*** This bug has been marked as a duplicate of bug 753882 ***

Note You need to log in before you can comment on or make changes to this bug.