Error message for a faulty ~/.profile script
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gdm |
Won't Fix
|
Medium
|
|||
gdm (Debian) |
New
|
Unknown
|
|||
gdm (Ubuntu) |
Fix Released
|
Low
|
Gunnar Hjalmarsson | ||
Trusty |
Fix Released
|
Low
|
Gunnar Hjalmarsson | ||
Utopic |
Fix Released
|
Low
|
Gunnar Hjalmarsson | ||
lightdm (Ubuntu) |
Fix Released
|
Low
|
Gunnar Hjalmarsson | ||
Trusty |
Fix Released
|
Low
|
Gunnar Hjalmarsson | ||
Utopic |
Fix Released
|
Low
|
Gunnar Hjalmarsson |
Bug Description
trusty and utopic SRU requests
=======
[Impact]
In case of a syntax error in either of ~/.profile or a few other similar files, the Xorg login is interrupted, and the user is taken back to the login screen without an explanation. Debugging this problem may be a time consuming exercise, especially for non-experienced users.
With the proposed change, lightdm/gdm does not try to load such a file, but shows a warning dialog instead. (A warning dialog is also shown in case of some other type of error, which would not have caused the login to fail.)
[Test Case]
To reproduce:
* Edit ~/.profile and add something bad, e.g. a non-closed parenthesis.
* Log out and find that you can't log in to a graphical session.
After installing the proposed lightdm/gdm version, you'll instead see the dialog and can log in.
[Regression Potential]
Since this is only about improved exception handling, it does not at all affect users with correct configuration files. The regression risk ought to be minimal.
[Original description]
Binary package hint: gdm
After adding "function AddPath { PATH="$1:$PATH" }" to $HOME/.profile made the Xorg startup fail. (At that moment I had already forgotten the changes made to the .profile). As I had autologin that meant it kept trying to login and finally showed me the graphics reconfiguration screen. That sent me to a huge hunt for xorg conf and setup problems.
Anyway finally tracked this down. I had used bash syntax in .profile file whereas it was run with sh.
This is not a bug per se but I think a user mistake in ".profile" shouldn't bring the whole xorg startup to a halt as it does with autologin. I propose running user ".profile" and ".xprofile" scripts so that Xsession script continues running even if they have errors. I'm not sure whether this change would have some negative effects as well.
1) Ubuntu Lucid, Linux egon-laptop 2.6.32-25-generic #45-Ubuntu SMP Sat Oct 16 19:48:22 UTC 2010 i686 GNU/Linux
2) gdm 2.30.2.
Changed in gdm (Ubuntu): | |
importance: | Undecided → Low |
Changed in gdm (Ubuntu): | |
status: | Confirmed → Triaged |
Changed in lightdm: | |
milestone: | none → 1.13.0 |
importance: | Undecided → Medium |
importance: | Medium → Low |
Changed in gdm (Ubuntu Trusty): | |
status: | New → Triaged |
Changed in lightdm (Ubuntu Trusty): | |
status: | New → Triaged |
importance: | Undecided → Low |
Changed in gdm (Ubuntu Trusty): | |
importance: | Undecided → Low |
Changed in lightdm (Ubuntu Trusty): | |
assignee: | nobody → Gunnar Hjalmarsson (gunnarhj) |
description: | updated |
Changed in lightdm: | |
status: | In Progress → Fix Committed |
Changed in lightdm (Ubuntu Trusty): | |
status: | Triaged → In Progress |
Changed in gdm: | |
importance: | Unknown → Medium |
status: | Unknown → New |
Changed in gdm (Ubuntu): | |
assignee: | nobody → Gunnar Hjalmarsson (gunnarhj) |
status: | Triaged → In Progress |
Changed in lightdm: | |
status: | Fix Committed → Fix Released |
Changed in gdm (Ubuntu Trusty): | |
assignee: | nobody → Gunnar Hjalmarsson (gunnarhj) |
status: | Triaged → In Progress |
Changed in gdm (Ubuntu Utopic): | |
assignee: | nobody → Gunnar Hjalmarsson (gunnarhj) |
status: | Triaged → In Progress |
Changed in gdm (Debian): | |
status: | Unknown → New |
tags: |
added: verification-needed-utopic removed: verification-done-utopic-lightdm verification-needed |
tags: |
added: verification-done removed: verification-done-trusty verification-needed-utopic |
Changed in gdm: | |
status: | New → Confirmed |
Changed in gdm: | |
status: | Confirmed → Won't Fix |
I had to set the -e option (errexit) in Xsession to make a ~/.profile error interrupt the startup. AFAICT that option is not set in the original Xsession script in GDM for Ubuntu.
Anyway, maybe there are still cases where a ~/.profile error may lead to the behavior you describe. The linked branch contains an idea for a fix that would handle ~/.profile and ~/.xprofile in a safer way.
If the solution is considered sensible, I suppose it should be forwarded upstream. Will await feedback before doing so.