gdm removes sbin directories from user paths

Bug #978259 reported by Reuben Thomas
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gdm (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When I start a GNOME 3 session with gdm as my login manager, my PATH lacks /sbin, /usr/sbin and /usr/local/sbin, even though those directories are configured to be in the PATH at the system level (/etc/environment). Also, it doesn't seem to have anything to do with login.defs, as ENV_PATH is there set to contain /usr/local/games, but that directory is not present in my PATH when I log in via GDM.

When I log in on a tty, the paths containing "sbin" are retained, so the problem appears not to be in my user's setup.

Googling finds several reports of this problem, all blaming gdm, but no solution (only the obvious workaround of adding those directories back into one's PATH in ~/.bashrc or ~/.profile).

Since it seems to be necessary to use gdm, rather than lightdm, for user switching to work properly in GNOME 3, I currently haven't another workaround.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: gdm 3.0.4-0ubuntu15
ProcVersionSignature: Ubuntu 3.2.0-20.28-lowlatency 3.2.12
Uname: Linux 3.2.0-20-lowlatency x86_64
ApportVersion: 2.0-0ubuntu5
Architecture: amd64
Date: Tue Apr 10 19:21:55 2012
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
ProcEnviron:
 TERM=xterm
 SHELL=/bin/bash
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 LANGUAGE=en_GB:en
SourcePackage: gdm
UpgradeStatus: Upgraded to precise on 2012-02-12 (57 days ago)

Revision history for this message
Reuben Thomas (rrt) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gdm (Ubuntu):
status: New → Confirmed
Revision history for this message
Nathan Grennan (ngrennan) wrote :

  It isn't that /etc/environment isn't being read. It is that something is overwriting the PATH. The lines below in /etc/pam.d/gdm do cause it to read /etc/environment. I can add things to /etc/environment and they will appear in my environment. Yet my PATH is still without sbins.

/etc/pam.d/gdm:
auth required pam_env.so readenv=1
auth required pam_env.so readenv=1 envfile=/etc/default/locale

Revision history for this message
Nathan Grennan (ngrennan) wrote :

It is gdm's fault. It seems to be gdm-simple-slave's fault via the code below. If you comment out the code below, it works as expected.

daemon/gdm-session-direct.c:

        /* 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);

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.