Allow .xsession-errors to be a symlink

Bug #771661 reported by Martin Pitt
28
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Light Display Manager
Triaged
Wishlist
Unassigned
Lucid Backports
Fix Released
Undecided
Unassigned
gdm
Fix Released
Medium
gdm (Ubuntu)
Fix Released
Undecided
Martin Pitt
Lucid
Fix Released
Undecided
Martin Pitt
kde-workspace (Ubuntu)
Won't Fix
Undecided
Unassigned

Bug Description

Binary package hint: gdm

Bug 60448 discusses the problem about ~/.xsession-errors growing unbearably large when there are buggy programs spamming it. One remedy is to allow ~/.xsession-errors to be a symlink to e. g. /dev/null or a local file, so that you can at least avoid network contention if ~ is on NFS.

scm sent a first patch for this (https://launchpadlibrarian.net/70203386/gdm-session-worker.c.diff). This should be cleaned up to use g_file_test() and reported upstream.

SRU TEST CASE:
 * Remove ~/.xsession-errors and ~/.xsession-errors.old
 * ln -s /tmp/xe ~/.xsession-errors
 * Reboot and log back in.
   -> Current behavior: the ~/.xsession-errors symlink gets rotated to ~/.xsession-errors.old, and a new ~/.xsession-errors is created as a regular file.
   -> Desired behaviour: ~/.xsession-errors remains a symlink, and the target file /tmp/xe is truncated for the new session.

Martin Pitt (pitti)
description: updated
Changed in gdm (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
status: New → In Progress
Martin Pitt (pitti)
Changed in gdm (Ubuntu):
status: In Progress → Fix Committed
Changed in gdm:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote :

Customer request to also backport the fix to 10.04 LTS.

Changed in gdm (Ubuntu Lucid):
assignee: nobody → Martin Pitt (pitti)
status: New → In Progress
description: updated
Revision history for this message
Martin Pitt (pitti) wrote :

I backported the patch to the current lucid version (applies cleanly), and uploaded to lucid-proposed. This needs an ubuntu-sru member to review and approve now.

Changed in gdm (Ubuntu Lucid):
status: In Progress → Fix Committed
Revision history for this message
Clint Byrum (clint-fewbar) wrote : Please test proposed package

Accepted gdm into lucid-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
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

The linked merge proposal will merge the lucid-proposed gdm branch into the lucid-backports ditto. I have built (locally), installed and tested the proposed branch successfully. It's also queued to be built at https://launchpad.net/~gunnarhj/+archive/lang-backports.

Changed in lucid-backports:
status: New → Confirmed
Revision history for this message
Scott Kitterman (kitterman) wrote :

Ack from ubuntu-backporters.

Changed in lucid-backports:
status: Confirmed → In Progress
Revision history for this message
scm (scm) wrote :

I can confirm that the version of gdm in lucid-proposed functions as expected.

Specifically I tested that changing .xsession-errors to a symlink both does not get overwritten and that the symlink destination gets created if it does not exist.

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

This bug was fixed in the package gdm - 2.32.1-0ubuntu4

---------------
gdm (2.32.1-0ubuntu4) oneiric; urgency=low

  [ Martin Pitt ]
  * Add 44_xsession-errors_symlink.patch: Don't rename .xsession-errors to
    .xsession-errors.old if the file is a symlink. The later code will
    truncate the file to zero anyway, so even in that case the file won't grow
    indefinitely. (LP: #771661)

  [ James Hunt ]
  * Updated gdm.conf to fix gdm in single user mode (LP: #436936)
 -- Stephane Graber <email address hidden> Mon, 02 May 2011 14:41:57 -0400

Changed in gdm (Ubuntu):
status: Fix Committed → Fix Released
tags: added: verification-done
removed: verification-needed
Revision history for this message
Etienne Goyer (etienne-goyer-outlands) wrote :

Same here, tested gdm 2.30.2.is.2.30.0-0ubuntu5.2 from lucid proposed, and it preserve .xsession-errors being a symlink across reboot and session logout. Looks good to me!

Revision history for this message
Martin Pitt (pitti) wrote :

Sponsored and accepted into lucid-backports, thanks!

Changed in lucid-backports:
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdm - 2.30.2.is.2.30.0-0ubuntu5.2

---------------
gdm (2.30.2.is.2.30.0-0ubuntu5.2) lucid-proposed; urgency=low

  * Add 44_xsession-errors_symlink.patch: Don't rename .xsession-errors to
    .xsession-errors.old if the file is a symlink. The later code will
    truncate the file to zero anyway, so even in that case the file won't grow
    indefinitely. (LP: #771661)
 -- Martin Pitt <email address hidden> Wed, 27 Apr 2011 17:56:59 +0200

Changed in gdm (Ubuntu Lucid):
status: Fix Committed → Fix Released
Revision history for this message
Alex Chiang (achiang) wrote :

I am noticing something strange with this patch.

I see that .xsession-errors -> /dev/null is indeed preserved correctly.

However, I also see that a new file named ~/.xsession-errors.XX6U63VV has also appeared, and that seems to be the new file that X is writing to. Is this expected?

Thanks.

Revision history for this message
Martin Pitt (pitti) wrote :

Alex,

this would happen if ~/.xsession-errors is not a regular file, i. e. symlink to a nonexisting file, or a pipe or something. So in your case /dev/null is not S_ISREG, so it would fall back to creating a new file.

Revision history for this message
Martin Pitt (pitti) wrote :

Reopening to catch the "symlink to character device" case as well.

Changed in gdm (Ubuntu):
status: Fix Released → In Progress
Martin Pitt (pitti)
Changed in gdm (Ubuntu):
status: In Progress → Fix Committed
Changed in gdm:
status: Confirmed → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

Yesterday I fixed the remaining case of ~/.xsession-errors -> /dev/null, and pushed the whole thing upstream:
http://git.gnome.org/browse/gdm/commit/?id=178459c33a64170d9ebe83ebbaeabeb05574f169

Changed in gdm:
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (5.5 KiB)

This bug was fixed in the package gdm - 3.0.4-0ubuntu1

---------------
gdm (3.0.4-0ubuntu1) oneiric; urgency=low

  [ Sebastien Bacher ]
  * New upstream version 3.0.0
  * Start cleaning for the GNOME3 update
  * debian/patches/00git_passwordless_login_crash.patch,
    debian/patches/17_use_timed_login_after_autologin.patch,
    debian/patches/19_no_greeter_for_autologin.patch,
    debian/patches/37_disable_resize_grip.patch,
    debian/patches/38_user_chooser_focus.patch,
    debian/patches/43_translate_cancel_button.patch:
    - those are fixed is in the new version
  * debian/patches/08_use_polkit_for_settings.patch,
    debian/patches/09_gdmsetup.patch:
    - drop gdmsetup, the options should be integrated in gnome-control-center
      (the autologin one is in the user account configuration for example)
  * debian/patches/09_gdmserver_gconf_settings.patch:
    - the gconf hack to turn on and off login sounds, that should be
      rewritten use gsettings if wanted, lightdm should also make that easier
  * debian/patches/10_xsplash.patch:
    - xsplash was a one cycle hack and has been deprecated since
  * debian/patches/24_respect_system_minuid.patch:
    - deprecated with the accountsservice use
  * debian/patches/25_update_gconf_directories.patch:
    - the new version use gsettings and that was useful for the
      gdmsetup configuration only
  * debian/patches/34_disable_a11y_default.patch:
    - the change was not appropriate for a sru but is fine early
      during the cycle
  * debian/%gconf-tree.xml:
    - tweaks to the default layout, those will need to be revisited with the
      new ui and gsettings if needed (no needed if lightdm is the default?)
  * Resynchronize some of the files on Debian to lower the difference

  [ Gunnar Hjalmarsson ]
  * debian/patches/36_language_environment_settings.patch:
    Set LC_CTYPE and LC_COLLATE to the same locale name as LC_MESSAGES
    (LP: #786986).
  * Patches adapted to gdm-3.0.0:
    - 15_default_session.patch
    - 30_don_t_save_failsafe_session.patch
    - 32-hide-mouse-cursor.patch
    - 45_time_display_on_greeter.patch
    - 90_register-bin-true-as-URI-scheme-handler-for-several-schemes.patch
  * debian/patches/45_time_display_on_greeter.patch:
    Display time on the greeter in a proper format also when
    /etc/default/locale assigns different locales to LANG respective
    LC_MESSAGES (LP: #777264).
  * debian/gdm.upstart:
    Export LC_MESSAGES so the weekday gets displayed in the system
    language on the greeter.
  * debian/patches/41_pt_time_format.patch:
    Patch deleted (superseded by 45_time_display_on_greeter.patch).

  [ Robert Ancell ]
  * debian/patches/42_no_ecryptfs_autologin.patch:
    - Only stop autologin if full home directory encryption is used
      (LP: #753707)

  [ Martin Pitt ]
  * New upstream version 3.0.4.
  * debian/control.in: Require accountsservice 0.6.12.
  * Drop 90_register-bin-true-as-URI-scheme-handler-for-several-schemes.patch:
    Fixed upstream in a different way.
  * debian/gdm.install: install the dummy desktop handler and the
    mimeapps.list to /usr/share/gdm/applications.
  * debian/rules: Drop installation of bonobo .server for FUSA,...

Read more...

Changed in gdm (Ubuntu):
status: Fix Committed → Fix Released
tags: added: testcase
Revision history for this message
Mechanical snail (replicator-snail) wrote :

I recall trying this fairly recently under KDE (Ubuntu Precise), and it did not preserve the symlink. So it seems this needs to be fixed in kdm as well.

no longer affects: kdebase (Ubuntu Lucid)
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Revision history for this message
Scott Kitterman (kitterman) wrote :

Correcting source package for kdm.

affects: kdebase (Ubuntu) → kde-workspace (Ubuntu)
Changed in kde-workspace (Ubuntu):
status: New → Confirmed
Revision history for this message
Harald Sitter (apachelogger) wrote :

This best be discussed and fixed by upstream. Please file a bug report at bugs.kde.org.

Changed in kde-workspace (Ubuntu):
status: New → Won't Fix
Revision history for this message
Xiyue Deng (manphiz) wrote :

Now that ubuntu uses lightdm by default, something similar should be implemented in lightdm as well.

A similar request is https://bugs.launchpad.net/ubuntu/+source/lightdm/+bug/1108518.

Changed in lightdm:
status: New → Triaged
importance: Undecided → Wishlist
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.