lightdm-session fails if user's .profile has non-posix sh init.

Bug #1097903 reported by Alec Warner
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
lightdm (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I don't actually mind the failure (its a feature!) The problem is that if the user's .profile has non-posix sh in it (causing /usr/sbin/lightdm-session to basically crash) there is no good presentation to the user about this.

The user tries to login.
Lightdm tries to source their ~/.profile, and crashes if they have non-posix sh in them.
lightdm simply restarts and drops the user back at the login screen.
There is no reporting to the user what happened, so they can fix the problem.

What is worse, is that the failsafe session doesn't work either.

-A

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

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

Changed in lightdm (Ubuntu):
status: New → Confirmed
Revision history for this message
Mikel Ward (mikelward) wrote :

Seems like the other issue is that the default .profile sources .bashrc if $BASH_VERSION is set. But $BASH_VERSION is set even if bash is invoked as /bin/sh. .bashrc is designed only for sourcing by bash, not bash in posix mode, or any other shell, given that bash itself does not source .bashrc by default in that mode.

A thought is it should do

if [ -n "$BASH_VERSION" ] && [ -n "$POSIXLY_CORRECT" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

but your point is still valid: lightdm could handle the user's shell exiting much better.

Revision history for this message
Thomas Langewouters (thomas-langewouters-l) wrote :

It took me a while to trace the problem to this issue.
These errors pointed me in the wrong direction: (I provide them here for other people, so this bug pops up in google)
Xorg.2.log:
[ 228.641] (EE) intel(0): [drm] failed to set drm interface version: Permission denied [13].
[ 228.641] (EE) intel(0): Failed to become DRM master.
$ LIBGL_DEBUG=verbose glxinfo:
libGL: OpenDriver: trying /usr/lib/i386-linux-gnu/dri/tls/i915_dri.so
libGL: OpenDriver: trying /usr/lib/i386-linux-gnu/dri/i915_dri.so

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.