Unable to log in when user-home is not read/writable by root

Bug #1313562 reported by FB
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
upstart
New
Undecided
Unassigned

Bug Description

We have a setup using centralized home directories (Ubunto 12.04, Kerberos, NFS4 and autofs) with kdm as our login manager.

We installed one of our testing machines with 14.04. Unfortunately we can no longer log in using kdm or lightdm (gdm won't even start). Lighdm will verify the user credentials but immediately return to the login prompt. KDM is stuck after the verification step and needs to be killed.

Upon investigating the issue, we found that "init --user" is causing problems when the users home directory is not read/writable by root. The first problem occurs in "/usr/share/upstart/sessions/dbus.con" pre-start. The script tries to write the DBUS_SESSION_BUS_ADDRESS into a temp-file in the users home (a file that is read by subsequent scripts) which fails causing "init --user" to fail with the message the "dbus-pre-start-process failed with return code 2"

We run our test using "xinit" setting the following environment before we start "init --user":
[code]
declare -x COMPIZ_CONFIG_PROFILE="ubuntu"
declare -x DEFAULTS_PATH="/usr/share/gconf/ubuntu.default.path"
declare -x DESKTOP_SESSION="ubuntu"
declare -x DISPLAY=":0"
declare -x GTK_IM_MODULE="ibus"
declare -x GTK_MODULES="overlay-scrollbar"
declare -x HOME="/home/atestuser"
declare -x IM_CONFIG_PHASE="1"
declare -x KRB5CCNAME="FILE:/tmp/krb5cc_1024_asfliouw"
declare -x LANG="de_DE.UTF-8"
declare -x LIBRARY_COMBO="gnu-gnu-gnu"
declare -x LOGNAME="atestuser"
declare -x MANDATORY_PATH="/usr/share/gconf/ubuntu.mandatory.path"
declare -x SESSIONTYPE="gnome-session"
declare -x SHLVL="1"
declare -x USER="atestuser"
declare -x WINDOWPATH="7"
declare -x XDG_CONFIG_DIRS="/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg"
declare -x XDG_DATA_DIRS="/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/"
declare -x XDG_RUNTIME_DIR="/run/user/1024"
declare -x XDG_SEAT="seat0"
declare -x XDG_SESSION_ID="c2"
declare -x XDG_CURRENT_DESKTOP="ubuntu"
declare -x XDG_VTNR="1"
declare -x XDM_MANAGED="method=classic"
declare -x XMODIFIERS="@im=ibus"
[/code]

Setting the HOME environment variable to something like /tmp allows us to start a gnome-session (we testest this with the xinit env as well as a forced HOME environment using lightdm and kdm). Disabeling upstart for the ubuntu session also fixes the login problem (however some of the status bar information like the time... won't work without upstart).

In our opinion the root process should never try to access a users home. Setup should be done when upstart switched to a userspace process.

Unfortunately this bug makes it impossible for us to use 14.04, as we did not find a workaround for this issue (besides using a window Manager that is not using upstart)

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 1313562] [NEW] Unable to log in when user-home is not read/writable by root

On Mon, Apr 28, 2014 at 08:18:21AM -0000, FB wrote:

> Upon investigating the issue, we found that "init --user" is causing
> problems when the users home directory is not read/writable by root. The
> first problem occurs in "/usr/share/upstart/sessions/dbus.con" pre-
> start. The script tries to write the DBUS_SESSION_BUS_ADDRESS into a
> temp-file in the users home (a file that is read by subsequent scripts)
> which fails causing "init --user" to fail with the message the "dbus-
> pre-start-process failed with return code 2"

init --user is run as the user, not as root. I don't think the problem is
related to the uid that upstart is running as. Why do you believe these
processes are running as root?

Revision history for this message
FB (bauer) wrote :

Hm, good point we tested so much, I am not sure how we came to that conclusion.

But thanks this was a great hint. Just reevaluated everything, and it looks like init --user (or more likely gnome-session, not sure which one is responsible there) is missing the environment variable XDG_CURRENT_DESKTOP.

Sorry for the confusion! And thanks for your help!

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.