Allow .xsession-errors to be a symlink

Bug #771661 reported by Martin Pitt on 2011-04-27
28
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Light Display Manager
Wishlist
Unassigned
Lucid Backports
Undecided
Unassigned
gdm
Fix Released
Medium
gdm (Ubuntu)
Undecided
Martin Pitt
Lucid
Undecided
Martin Pitt
kde-workspace (Ubuntu)
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) on 2011-04-27
description: updated
Changed in gdm (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
status: New → In Progress
Martin Pitt (pitti) on 2011-04-27
Changed in gdm (Ubuntu):
status: In Progress → Fix Committed
Changed in gdm:
importance: Unknown → Medium
status: Unknown → Confirmed
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
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

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
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
Scott Kitterman (kitterman) wrote :

Ack from ubuntu-backporters.

Changed in lucid-backports:
status: Confirmed → In Progress
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.

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

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!

Martin Pitt (pitti) wrote :

Sponsored and accepted into lucid-backports, thanks!

Changed in lucid-backports:
status: In Progress → Fix Released
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
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.

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.

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) on 2011-06-07
Changed in gdm (Ubuntu):
status: In Progress → Fix Committed
Changed in gdm:
status: Confirmed → In Progress
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
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

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)
Launchpad Janitor (janitor) wrote :

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

Scott Kitterman (kitterman) wrote :

Correcting source package for kdm.

affects: kdebase (Ubuntu) → kde-workspace (Ubuntu)
Changed in kde-workspace (Ubuntu):
status: New → Confirmed
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
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  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.