GNOME Bugzilla – Bug 682907
GDM_SESSION_DEFAULT_PATH overrides system default user PATH
Last modified: 2012-08-29 20:29:00 UTC
GDM hardwires the user's initial PATH, via GDM_SESSION_DEFAULT_PATH. See https://bugs.launchpad.net/ubuntu/+source/gdm/+bug/978259 for a description of the problem, and suggested solution, and https://bugs.launchpad.net/ubuntu/+source/gdm/+bug/844103 for another discussion (the two bugs are duplicates, with the latter authoritative). I presume there is a reason why the code for GDM_SESSION_DEFAULT_PATH exists, so assuming that the suggestion to simply comment out the setting of PATH is impractical, is there a chance of allowing gdm to be configured so that (on systems where PATH is reliably set by PAM or some other mechanism) GDM_SESSION_DEFAULT_PATH is overridden by the system setting? Otherwise, gdm must be recompiled whenever the default PATH is changed, which seems a bit hard on sysadmins.
we could probably only set GDM_SESSION_DEFAULT_PATH if PATH is unset, and use PATH otherwise. Of course, PATH would need to be set before GDM is started. Is that the case?
PATH is not set before GDM is started, at least, not for the purposes of this bug. The setting of PATH that is important is the default setting for users once they have logged in, and of course when gdm is running they have not yet logged in. Hence, it seems that GDM_SESSION_DEFAULT_PATH only makes sense when gdm is being used in such a way that there is no login step (automatic or otherwise).
ah so the problem (i think) is that pam_env is refusing to overwrite the default we put in place. it looks like this is configurable in pam_env.conf but not /etc/environment. The launchpad link posts this snippet: /* FIXME: We do this here and in the session worker. We should consolidate * somehow. */ gdm_session_direct_set_environment_variable (session, "PATH", strcmp (BINDIR, "/usr/bin") == 0? GDM_SESSION_DEFAULT_PATH : BINDIR ":" GDM_SESSION_DEFAULT_PATH); Well we should just fix the FIXME. Drop gdm_session_direct_set_environment_variable (session) and instead do it soley session-worker (if it wasn't already done by exec() time
The following fix has been pushed: d3b749e slave: don't set PATH in two places I think this should fix it, if not please reopen.
Created attachment 222841 [details] [review] slave: don't set PATH in two places It's redundant and causing confusion with pam_env.