Comment 15 for bug 52685

Revision history for this message
Mark Wilkinson (mhw) wrote :

An additional duplication: x11-common and xinit both install a copy of /etc/X11/Xsession but they supply different versions of the file, so the version that's actually used depends on the installation order.

$ grep '/etc/X11/Xsession ' /var/lib/dpkg/status
 /etc/X11/Xsession 1fd6001d0552b870f416dde954e0f060
 /etc/X11/Xsession bc9abf656f3a702294d490eb1554359b
$

The first one is the instance of the file from the xinit package, the second one from x11-common. On my clean install of Feisty I finished up with the version from the xinit package installed, but this version seems to predate the one in x11-common. Here's a diff:

$ diff -u [x11-common]/Xsession /etc/X11/Xsession
--- /m/migrate/d600/etc/X11/Xsession 2006-10-12 16:33:54.000000000 +0100
+++ /etc/X11/Xsession 2006-08-07 20:02:19.000000000 +0100
@@ -4,7 +4,7 @@
 #
 # global Xsession file -- used by display managers and xinit (startx)

-# $Id: Xsession 967 2005-12-27 07:20:55Z dnusinow $
+# $Id: Xsession 1507M 2004-09-13 07:36:26Z (local) $

 set -e

@@ -42,7 +42,7 @@
   # the user would have dismissed the error we want reported before seeing the
   # request to report it.
   errormsg "$*" \
- "Please report the installed version of the \"x11-common\"" \
+ "Please report the installed version of the \"xfree86-common\"" \
            "package and the complete text of this error message to" \
            "<email address hidden>."
 }
@@ -56,7 +56,7 @@
     internal_errormsg "run_parts() called, but \"$1\" does not exist or is" \
                       "not a directory."
   fi
- for F in $(/bin/ls $1); do
+ for F in $(ls $1); do
     if expr "$F" : '[[:alnum:]_-]\+$' > /dev/null 2>&1; then
       if [ -f "$1/$F" ]; then
         echo "$1/$F"
@@ -78,7 +78,7 @@
 ERRFILE=$HOME/.xsession-errors

 # attempt to create an error file; abort if we cannot
-if (umask 077 && touch "$ERRFILE") 2> /dev/null && [ -w "$ERRFILE" ] &&
+if touch "$ERRFILE" 2> /dev/null && [ -w "$ERRFILE" ] &&
   [ ! -L "$ERRFILE" ]; then
   chmod 600 "$ERRFILE"
 elif ERRFILE=$(tempfile 2> /dev/null); then
@@ -91,12 +91,6 @@
   errormsg "unable to create X session log/error file; aborting."
 fi

-# truncate ERRFILE if it is too big to avoid disk usage DoS
-if [ "`stat -c%s \"$ERRFILE\"`" -gt 500000 ]; then
- T=`mktemp -p "$HOME"`
- tail -c 500000 "$ERRFILE" > "$T" && mv -f "$T" "$ERRFILE" || rm -f "$T"
-fi
-
 exec >>"$ERRFILE" 2>&1

 echo "$PROGNAME: X session started for $LOGNAME at $(date)"
@@ -124,11 +118,9 @@
 # other
 SESSIONFILES=$(run_parts $SYSSESSIONDIR)
 if [ -n "$SESSIONFILES" ]; then
- set +e
   for SESSIONFILE in $SESSIONFILES; do
     . $SESSIONFILE
   done
- set -e
 fi

 exit 0
$