Ubuntu

.Xauthority sometimes owned by root, which blocks login

Reported by Martin Vysny on 2011-10-10
202
This bug affects 37 people
Affects Status Importance Assigned to Milestone
Light Display Manager
Undecided
Unassigned
lightdm (Ubuntu)
High
Robert Ancell
Oneiric
High
Robert Ancell

Bug Description

Each time I upgrade to a newer ubuntu on a particular machine, something breaks. Last time I was unable to log in via GDM and I have to reinstall the machine. This time, I upgraded to oneiric today, and, of course, lightdm cannot start unity nor unity-2d: after entering a correct password it just restarts itself.
This is a report using apport-cli - a duplicate of https://bugs.launchpad.net/ubuntu/+bug/871664

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: lightdm 1.0.1-0ubuntu6
ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
Uname: Linux 3.0.0-12-generic x86_64
ApportVersion: 1.23-0ubuntu3
Architecture: amd64
Date: Mon Oct 10 11:58:51 2011
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, user)
 LANG=en_US.UTF-8
 LANGUAGE=en_US.utf8
SourcePackage: lightdm
UpgradeStatus: Upgraded to oneiric on 2011-10-10 (0 days ago)

Martin Vysny (vyzivus) wrote :
Martin Vysny (vyzivus) wrote :
Martin Vysny (vyzivus) wrote :
Martin Vysny (vyzivus) wrote :
Martin Vysny (vyzivus) wrote :
Martin Vysny (vyzivus) wrote :
Martin Vysny (vyzivus) wrote :

Guest account can log in, but unity does not start - only a menu is shown in the upper menu bar. When I create user (sudo useradd -m -s /bin/bash foo), the new user can log in no problem, and also unity launches correctly.

Martin Vysny (vyzivus) wrote :
Martin Vysny (vyzivus) wrote :

I switched to gdm, which is able to log me in and start the unity-2d session.

Sebastien Bacher (seb128) wrote :

the log has this error

"[+4.07s] DEBUG: Removing session authority from /home/vyzivus/.Xauthority
[+4.07s] WARNING: Error reading existing Xauthority: Error opening file: Permission denied"

does removing .Xauthority from a vt and then logging in lightdm works?

Martin Vysny (vyzivus) wrote :

Many thanks, it worked!

summary: - unity does not start and the lightdm restarts after login
+ Stalled .Xauthority can block login
Martin Pitt (pitti) on 2011-10-12
summary: - Stalled .Xauthority can block login
+ .Xauthority sometimes owned by root, which blocks login
Changed in lightdm (Ubuntu):
importance: Undecided → High
Launchpad Janitor (janitor) wrote :

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

Changed in lightdm (Ubuntu):
status: New → Confirmed
Sebastien Bacher (seb128) wrote :

Robert, do you have some ideas about this one? Colin just ran into the issue, it seems to happen randomly to some users and virtual let them with no way to log in (if they don't know to vt switch and rm the file)

Changed in lightdm (Ubuntu Oneiric):
assignee: nobody → Robert Ancell (robert-ancell)
Sebastien Bacher (seb128) wrote :

bug #855773 was similar and closed, Robert wrote "For the recent security fix LightDM has to drop privileges to write the authority file, but I guess it could be set wrong." and "I'm going to close this. I think lightdm can't do anything sane in this case. Thanks for the bug report!"

So it might not be a lightdm issue since the owner doesn't match what lightdm would set?

tags: added: rls-mgr-o-tracking
Philipp Gassmann (phiphi.g) wrote :

Affected me and others after upgrade to final release!

http://ubuntuforums.org/showthread.php?t=1859233

Possible fix proposed in duplicate bug #855773:
Martin Pitt (pitti) wrote on 2011-10-12:
lightdm could remove the file. It's in an user writable directory.

Robert Ancell (robert-ancell) wrote :

Is anyone experiencing this who's upgraded directly from 11.04 to 11.10? (i.e. didn't upgrade to any of the Oneiric development releases). My guess is there was a version of LightDM that incorrectly wrote this file with root permissions and upgrading from that version triggers the problem.

The attachment "Propsed patch that corrects permissions for ~/.Xauthority" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Sebastien Bacher (seb128) wrote :

The patch got commited to the vcs

Changed in lightdm (Ubuntu):
status: Confirmed → Fix Committed
Changed in lightdm (Ubuntu Oneiric):
status: Confirmed → In Progress
Walldorf2000 (walldorf2000) wrote :

Reply for #16:
I just upgraded two days ago directly from 11.04 to 11.11 via online update. I never had lightdm on this machine before. Thus the problem exists is in the current version.

AFAIKT the patch repairs the bug but does not fix the root cause, right? (Never mind, just for the sake of completeness. Main thing is that the problem is fixed.)

My bug
https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/878515
seems to be a dupe of this one.

Only the user which made the upgrade was affected. The other users work.

I will try to change ownership/authorizations of ~/.Xauthority this evening.

Reply for #19:
When will this patch be available for system actualization? When the status of Oneiric changes from "In Progress" to "Fix Committed"?

Lars Ola Liavåg (l-liavag) wrote :

I issued bug #877622, which was marked as a duplicate of this one. I've now worked around the problem by issuing the following command in the terminal:

 sudo chown -R username:username /home/username

This allowed me to log in graphically to my user account for the first time after I did a clean install over Natty. Recreating the other user accounts in the GUI perfectly reconnected them with their home directories and I haven't experienced any problems so far. I'm going to wait a couple of weeks before installing Oneiric to my other two machines, however.

Changed in lightdm (Ubuntu Oneiric):
status: In Progress → Fix Committed

Hi,

I got the same problem after upgrading from 11.04 to 11.10 on an xubuntu release. I had to remove another file to make it work:
rm -f ~/.ICEauthority

Thx for the help

Hello Martin, or anyone else affected,

Accepted lightdm into oneiric-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Walldorf2000 (walldorf2000) wrote :

My start screen also shows Xubuntu. Originally I installed Xubuntu some years ago (I think it was 6.04). But I use ubuntu-desktop for a long time. Maybe this is somehow related?

Is anybody affected who never used Xubuntu?

Reply for #23:
Unfortunately I can't test the fix since I already changed ownership.

Matthias Metzger (macellarius) wrote :

For me the packages from the "proposed" repository are working.

tags: added: verification-done
removed: verification-needed
Eli Spizzichino (scrivi-gmail) wrote :

I bumped into this as well, with lightdm and gdm after a release upgrade from 11.04.
The proposed solution to remove, ~/.Xauthority and ~/.ICEauthority doesn't work for me.
I still don't have the solution of what triggers this but I suggest to fiddle with .profile, excluding some lines make the issue apparently go away. (However I can't afford to comment out addsshagent or virtualenwrapper in my setup)
I notice a weird thing: even declaring a simple function in my .profile triggers the problem ie:
damn() { export foo="boo" }
damn

this cause the gdm/lightdm not to login as described here. Does this make any sense to you? Do you experience the same?

With kdm (no matters if I go to kde or gnome) my usual .profile expose no problems and I can enter but I have another possibly related issue it fails to gracefully terminate the session the screen remains still with just the background and the mouse pointer (still working) with no activity!

On three stupid login programs I can't even use one.
if you have ideas please suggest, I don't think I have a very special setup but I'll post info if required

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lightdm - 1.0.6-0ubuntu2

---------------
lightdm (1.0.6-0ubuntu2) precise; urgency=low

  * Upload to precise.

lightdm (1.0.6-0ubuntu1) oneiric-proposed; urgency=low

  [ Martin Pitt ]
  * debian/lightdm.upstart: Put back check for "text" in kernel command line,
    for inhibiting automatic lightdm start. Check $JOB to still allow a manual
    "start lightdm" command to work. (LP: #873334)

  [ Robert Ancell ]
  * New upstream release:
    - Use lchown for correcting ownership of ~/.Xauthority instead of chown

lightdm (1.0.5-0ubuntu1) oneiric-proposed; urgency=low

  * New upstream release.
    [1.0.5]
    - Relax AppArmor guest profile to allow compiz to start
    - Connect up VNC settings for width, height, depth
    [1.0.4]
    - Fix --enable-gtk-greeter=yes not working
    - Fix X sessions with arguments in Exec not working
    - Use previous session for automatic login or if greeter does not request
      one. (LP: #834515)
    - Correct ownership of ~/.Xauthority if upgrading from buggy version of
      LightDM that had it root owned. (LP: #871667)
    - Set default resolution of VNC to 1024x768, add settings for width, height,
      depth into lightdm.conf.
    - AppArmor profile: Fix broken gnome-keyring and dbus/gwibber, and quiesce
      annoying kernel audit messages for privileges that we definitively do not
      want to grant. (LP: #877736) (LP: #874635)
    - Set LOGNAME environment variable (LP: #875705)
    - Mark strings as translatable in GTK greeter (LP: #868613)
    [ 1.0.3]
    - Fix reference counting issue in ConsoleKit code
    - Really add the lightdm-guest-session-wrapper
    [ 1.0.2 ]
    - Fix daemon from blocking if Accounts Service does not exist
    - Fix greeter log file not being written
    - Don't set LANG environment variable if using Accounts Service.
    - Fix gdmflexiserver not working due to it not being in PATH
    - Don't authenticate the greeter user
    - Allow greeters to be disabled in configure flags
    - Fix over allocation of read buffer in greeter protocol
    - Make sure objects are cleaned up on exit
    - Fix minor memory leaks
    - Fix hugely oversized allocation in greeter buffer. Can trigger
      crashes when entering very long passwords.
  * debian/patches/00bzr_guest_session_wrapper.diff:
  * debian/patches/07_long_password_crash.patch:
  * debian/patches/08_correct_ck_ref.patch:
    - Applied upstream
  * New upstream release.
 -- Martin Pitt <email address hidden> Thu, 10 Nov 2011 07:19:12 +0100

Changed in lightdm (Ubuntu):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lightdm - 1.0.6-0ubuntu1

---------------
lightdm (1.0.6-0ubuntu1) oneiric-proposed; urgency=low

  [ Martin Pitt ]
  * debian/lightdm.upstart: Put back check for "text" in kernel command line,
    for inhibiting automatic lightdm start. Check $JOB to still allow a manual
    "start lightdm" command to work. (LP: #873334)

  [ Robert Ancell ]
  * New upstream release:
    - Use lchown for correcting ownership of ~/.Xauthority instead of chown

lightdm (1.0.5-0ubuntu1) oneiric-proposed; urgency=low

  * New upstream release.
    [1.0.5]
    - Relax AppArmor guest profile to allow compiz to start
    - Connect up VNC settings for width, height, depth
    [1.0.4]
    - Fix --enable-gtk-greeter=yes not working
    - Fix X sessions with arguments in Exec not working
    - Use previous session for automatic login or if greeter does not request
      one. (LP: #834515)
    - Correct ownership of ~/.Xauthority if upgrading from buggy version of
      LightDM that had it root owned. (LP: #871667)
    - Set default resolution of VNC to 1024x768, add settings for width, height,
      depth into lightdm.conf.
    - AppArmor profile: Fix broken gnome-keyring and dbus/gwibber, and quiesce
      annoying kernel audit messages for privileges that we definitively do not
      want to grant. (LP: #877736) (LP: #874635)
    - Set LOGNAME environment variable (LP: #875705)
    - Mark strings as translatable in GTK greeter (LP: #868613)
    [ 1.0.3]
    - Fix reference counting issue in ConsoleKit code
    - Really add the lightdm-guest-session-wrapper
    [ 1.0.2 ]
    - Fix daemon from blocking if Accounts Service does not exist
    - Fix greeter log file not being written
    - Don't set LANG environment variable if using Accounts Service.
    - Fix gdmflexiserver not working due to it not being in PATH
    - Don't authenticate the greeter user
    - Allow greeters to be disabled in configure flags
    - Fix over allocation of read buffer in greeter protocol
    - Make sure objects are cleaned up on exit
    - Fix minor memory leaks
    - Fix hugely oversized allocation in greeter buffer. Can trigger
      crashes when entering very long passwords.
  * debian/patches/00bzr_guest_session_wrapper.diff:
  * debian/patches/07_long_password_crash.patch:
  * debian/patches/08_correct_ck_ref.patch:
    - Applied upstream
  * New upstream release.
 -- Robert Ancell <email address hidden> Wed, 02 Nov 2011 11:37:43 -0400

Changed in lightdm (Ubuntu Oneiric):
status: Fix Committed → Fix Released
Quico Beltrà (quico) wrote :

This bug affect to version 12.10, too.

I have removed .Xauthority from a vt and then logging in lightdm works

Florent Viard (fviard) wrote :

A colleague of mine was also affected by this bug upgrading to 12.04.
Just had to change the owner of the .Xauthority file:
chown myuser:myuser /home/myuser/.Xauthority
(.Xauthority was previously owned by root).

But from the user point of view, this bug is really hard to understand. When he try to login, the screen just get back to the login screen after few seconds. There is no error message, neither no log about what is the issue anywhere.

It would be good to at least have an error message giving a clue about what is the problem.

tags: added: logout
tags: added: 12.04 greeter precise
tags: added: ubuntu

I had the same bug after upgrading from 12.04 to 12.10

eljoest (eljoest) wrote :

I had the issue while running 12.04 (not updating). With 12.10 the lightdm issue is still present.

neutron68 (neutron68) wrote :

It appears that lightdm 1.2.3 still has the problem.

The issue cropped up in an install of 64-bit Mythbuntu 12.04, after it had been running fine for about 15 months.
The nvidia 6150 chip was failing and locking up the system randomly, so it was replaced with an nvidia 8600GTS PCI-E card.
After the first successful boot with the 8600GTS card, the user could not log in to the PC, until the /home/username/.Xauthority file ownership was changed from root to the users username.

The /var/log/lightdm file shows that lightdm 1.2.3 is running.

[+0.00s] DEBUG: Logging to /var/log/lightdm/lightdm.log
[+0.00s] DEBUG: Starting Light Display Manager 1.2.3, UID=0 PID=1351
[+0.00s] DEBUG: Loaded configuration from /etc/lightdm/lightdm.conf
[+0.00s] DEBUG: Using D-Bus name org.freedesktop.DisplayManager

The following files are in the apt archives on the machine, dated July 19, 2003:
/var/cache/apt/archives/liblightdm-gobject-1-0_1.2.3-0ubuntu2.3_amd64.deb
/var/cache/apt/archives/lightdm_1.2.3-0ubuntu2.3_amd64.deb

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

Other bug subscribers

Related questions