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.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to lightdm in Ubuntu.
https://bugs.launchpad.net/bugs/1097903

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

Status in “lightdm” package in Ubuntu:
  Confirmed

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/1097903/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to