Bug#690197: gdm3: fails to correctly add XDMCP user's session to utmp

Paul Szabo paul.szabo at sydney.edu.au
Thu Oct 11 02:49:26 UTC 2012


Package: gdm3
Version: 3.4.1-3
Severity: normal
Tags: upstream patch


This bug has previously been reported for package GDM in
http://bugs.debian.org/551802
Please see there for history and details. Briefly quoting:

  ... All users are given the id that corresponds to the first
  4 characters of the host, which taking into account that no
  resolution is used, tends to be "192.". Since this id is
  supposed to be unique, all users are registered with the
  same id, and only one is shown.
  ...
  ... gdm tries to manage the utmp record setting the id of
  the record to be the first part of display name, the id is
  defined to be 4 bytes long, and the display name for xdmcp
  clients is of the form ip:display_number, so, xdmcp users in
  the same /8 network end up overwriting the other user utmp
  record.

This bug has been forwarded upstream:
https://bugzilla.gnome.org/show_bug.cgi?id=599103
I have just posted an as-yet-untested patch there, attached here also.

Cheers, Paul

Paul Szabo   psz at maths.usyd.edu.au   http://www.maths.usyd.edu.au/u/psz/
School of Mathematics and Statistics   University of Sydney    Australia


-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.2.23-pk06.06-i386 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages gdm3 depends on:
ii  accountsservice                             0.6.21-6
ii  adduser                                     3.113+nmu3
ii  dconf-gsettings-backend                     0.12.1-2
ii  dconf-tools                                 0.12.1-2
ii  debconf [debconf-2.0]                       1.5.46
ii  dpkg                                        1.16.8
ii  gir1.2-freedesktop                          1.32.1-1
ii  gir1.2-glib-2.0                             1.32.1-1
ii  gnome-session [x-session-manager]           3.4.2.1-2
ii  gnome-session-bin                           3.4.2.1-2
ii  gnome-session-fallback [x-session-manager]  3.4.2.1-2
ii  gnome-settings-daemon                       3.4.2-5
ii  gnome-terminal [x-terminal-emulator]        3.4.1.1-1+build1
ii  gsettings-desktop-schemas                   3.4.2-1
ii  libaccountsservice0                         0.6.21-6
ii  libatk1.0-0                                 2.4.0-2
ii  libattr1                                    1:2.4.46-8
ii  libaudit0                                   1:1.7.18-1.1
ii  libc6                                       2.13-35
ii  libcairo-gobject2                           1.12.2-2
ii  libcairo2                                   1.12.2-2
ii  libcanberra-gtk3-0                          0.28-5
ii  libcanberra0                                0.28-5
ii  libdbus-1-3                                 1.6.0-1
ii  libdbus-glib-1-2                            0.100-1
ii  libfontconfig1                              2.9.0-7
ii  libgdk-pixbuf2.0-0                          2.26.1-1
ii  libglib2.0-0                                2.32.3-1
ii  libglib2.0-bin                              2.32.3-1
ii  libgtk-3-0                                  3.4.2-3
ii  libpam-modules                              1.1.3-7.1
ii  libpam-runtime                              1.1.3-7.1
ii  libpam0g                                    1.1.3-7.1
ii  libpango1.0-0                               1.30.0-1
ii  librsvg2-common                             2.36.1-1
ii  libselinux1                                 2.1.9-5
ii  libupower-glib1                             0.9.17-1
ii  libwrap0                                    7.6.q-24
ii  libx11-6                                    2:1.5.0-1
ii  libxau6                                     1:1.0.7-1
ii  libxdmcp6                                   1:1.1.1-1
ii  libxklavier16                               5.2.1-1
ii  libxrandr2                                  2:1.3.2-2
ii  lsb-base                                    4.1+Debian7
ii  metacity [x-window-manager]                 1:2.34.3-3
ii  policykit-1-gnome                           0.105-2
ii  sawfish [x-window-manager]                  1:1.5.3-2.1+b1
ii  upower                                      0.9.17-1
ii  x11-common                                  1:7.7+1
ii  x11-xserver-utils                           7.7~3
ii  xfce4-session [x-session-manager]           4.8.3-2+b1
ii  xfwm4 [x-window-manager]                    4.8.3-2
ii  xterm [x-terminal-emulator]                 278-2

Versions of packages gdm3 recommends:
ii  at-spi2-core               2.5.3-1
ii  desktop-base               7.0.3
ii  gnome-icon-theme           3.4.0-2
ii  gnome-icon-theme-symbolic  3.4.0-2
ii  x11-xkb-utils              7.7~1
ii  xserver-xephyr             2:1.12.3.902-1
ii  xserver-xorg               1:7.7+1
ii  zenity                     3.4.0-2

Versions of packages gdm3 suggests:
pn  gnome-orca            <none>
ii  gnome-shell           3.4.2-1
pn  gok                   <none>
ii  libpam-gnome-keyring  3.4.1-5

-- Configuration Files:
/etc/gdm3/Init/Default changed:
PATH=/usr/sms/bin:/usr/local/bin:/usr/bin:/bin
OLD_IFS=$IFS
gdmwhich () {
  COMMAND="$1"
  OUTPUT=
  IFS=:
  for dir in $PATH
  do
    if test -x "$dir/$COMMAND" ; then
      if test "x$OUTPUT" = "x" ; then
        OUTPUT="$dir/$COMMAND"
      fi
    fi
  done
  IFS=$OLD_IFS
  echo "$OUTPUT"
}
sysmodmap=/etc/X11/Xmodmap
XMODMAP=`gdmwhich xmodmap`
if [ "x$XMODMAP" != "x" ] ; then
  if [ "x$GDM_PARENT_DISPLAY" = "x" ]; then
    if [ -f $sysmodmap ]; then
      $XMODMAP $sysmodmap
    fi
  else
    ( DISPLAY=$GDM_PARENT_DISPLAY XAUTHORITY=$GDM_PARENT_XAUTHORITY $XMODMAP -pke ) | $XMODMAP -
  fi
  #
  # Switch Sun's Alt and Meta mod mappings
  #
  UNAME=`gdmwhich uname`
  PROCESSOR=`$UNAME -p`
  if [ "x$PROCESSOR" = "xsparc" ]; then
    if $XMODMAP | grep mod4 | grep Alt > /dev/null 2>/dev/null
    then
      $XMODMAP -e "clear Mod1" \
               -e "clear Mod4" \
               -e "add Mod1 = Alt_L" \
               -e "add Mod1 = Alt_R" \
               -e "add Mod4 = Meta_L" \
               -e "add Mod4 = Meta_R"
    fi
  fi
fi
SETXKBMAP=`gdmwhich setxkbmap`
if [ "x$SETXKBMAP" != "x" ] ; then
  # FIXME: is this all right?  Is this completely on crack?
  # What this does is move the xkb configuration from the GDM_PARENT_DISPLAY
  # FIXME: This should be done in code.  Or there must be an easier way ...
  if [ -n "$GDM_PARENT_DISPLAY" ]; then
    XKBSETUP=`( DISPLAY=$GDM_PARENT_DISPLAY XAUTHORITY=$GDM_PARENT_XAUTHORITY $SETXKBMAP -v )`
    if [ -n "$XKBSETUP" ]; then
      XKBKEYMAP=`echo "$XKBSETUP" | grep '^keymap' | awk '{ print $2 }'`
      XKBTYPES=`echo "$XKBSETUP" | grep '^types' | awk '{ print $2 }'`
      XKBCOMPAT=`echo "$XKBSETUP" | grep '^compat' | awk '{ print $2 }'`
      XKBSYMBOLS=`echo "$XKBSETUP" | grep '^symbols' | awk '{ print $2 }'`
      XKBGEOMETRY=`echo "$XKBSETUP" | grep '^geometry' | awk '{ print $2 }'`
      if [ -n "$XKBKEYMAP" ]; then
        $SETXKBMAP -keymap "$XKBKEYMAP"
      elif [ -n "$XKBTYPES" -a -n "$XKBCOMPAT" -a -n "$XKBSYMBOLS" -a -n "$XKBGEOMETRY" ]; then
        $SETXKBMAP -types "$XKBTYPES" -compat "$XKBCOMPAT" -symbols "$XKBSYMBOLS" -geometry "$XKBGEOMETRY"
      elif [ -n "$XKBTYPES" -a -n "$XKBCOMPAT" -a -n "$XKBSYMBOLS" ]; then
        $SETXKBMAP -types "$XKBTYPES" -compat "$XKBCOMPAT" -symbols "$XKBSYMBOLS"
      elif [ -n "$XKBSYMBOLS" ]; then
        $SETXKBMAP -symbols "$XKBSYMBOLS"
      fi
    fi
  fi
fi
exit 0

/etc/gdm3/PreSession/Default changed:

/etc/gdm3/Xsession changed:
PROGNAME=Xsession
message () {
  # pretty-print messages of arbitrary length; use xmessage if it
  # is available and $DISPLAY is set
  MESSAGE="$PROGNAME: $*"
  echo "$MESSAGE" | fold -s -w ${COLUMNS:-80} >&2
  if [ -n "$DISPLAY" ]; then
    if [ -n "$zenity" ]; then
      "$zenity" --info --text "$MESSAGE"
    elif [ -n "$xmessage" ]; then
      echo "$MESSAGE" | fold -s -w ${COLUMNS:-80} | $xmessage -center -file -
    fi
  fi
}
message_nonl () {
  # pretty-print messages of arbitrary length (no trailing newline); use
  # xmessage if it is available and $DISPLAY is set
  MESSAGE="$PROGNAME: $*"
  echo -n "$MESSAGE" | fold -s -w ${COLUMNS:-80} >&2;
  if [ -n "$DISPLAY" ]; then
    if [ -n "$zenity" ]; then
      "$zenity" --info --text "$MESSAGE"
    elif [ -n "$xmessage" ]; then
      echo -n "$MESSAGE" | fold -s -w ${COLUMNS:-80} | $xmessage -center -file -
    fi
  fi
}
errormsg () {
  # exit script with error
  message "$*"
  exit 1
}
internal_errormsg () {
  # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
  # One big call to message() for the sake of xmessage; if we had two then
  # 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 \"xfree86-common\"" \
           "package and the complete text of this error message to" \
           "<debian-x at lists.debian.org>."
}
run_parts () {
  # until run-parts --noexec is implemented
  if [ -z "$1" ]; then
    internal_errormsg "run_parts() called without an argument."
  fi
  if [ ! -d "$1" ]; then
    internal_errormsg "run_parts() called, but \"$1\" does not exist or is" \
                      "not a directory."
  fi
  for F in $(/bin/ls $1); do
    if expr "$F" : '[[:alnum:]_-]\+$' > /dev/null 2>&1; then
      if [ -f "$1/$F" ]; then
        echo "$1/$F"
      fi
    fi
  done
}
OPTIONFILE=/etc/X11/Xsession.options
SYSRESOURCES=/etc/X11/Xresources
USRRESOURCES=$HOME/.Xresources
SYSSESSIONDIR=/etc/X11/Xsession.d
USERXSESSION=$HOME/.xsession
USERXSESSIONRC=$HOME/.xsessionrc
ALTUSERXSESSION=$HOME/.Xsession
echo "$0: Beginning session setup for $*"
test -f /etc/profile && . /etc/profile
test -f "$HOME/.profile" && . "$HOME/.profile"
test -f /etc/xprofile && . /etc/xprofile
test -f "$HOME/.xprofile" && . "$HOME/.xprofile"
zenity=`which zenity 2>/dev/null`
xmessage=`which xmessage 2>/dev/null`
command="$1"
if [ -z "$command" ] ; then
  command=failsafe
fi
if [ x"$command" = xfailsafe ] ; then
  if [ -n "$zenity" ] ; then
    "$zenity" --info --text "This is the failsafe xterm session.  Windows now have focus only if you have your cursor above them.  To get out of this mode type 'exit' in the window in the upper left corner"
  else
    echo "$0: Starting the failsafe xterm session."
  fi
  exec xterm -geometry 80x24+0+0
fi
freetemp=`which freetemp 2>/dev/null`
if [ -n "$freetemp" ] ; then
        "$freetemp"
fi
usermodmap="$HOME/.Xmodmap"
userxkbmap="$HOME/.Xkbmap"
if [ -f "$userxkbmap" ]; then
    setxkbmap `cat "$userxkbmap"`
    XKB_IN_USE=yes
fi
if [ -z "$XKB_IN_USE" ]; then
    if [ -f "$usermodmap" ]; then
       xmodmap "$usermodmap"
    fi
fi
unset XKB_IN_USE
if [ -n "$GDM_LANG" ]; then
    # Set the locale to that, it's the language selected in GDM.
    LANG="$GDM_LANG"
    export LANG
    if [ -n "$LC_ALL" ] && [ "$LC_ALL" != "$LANG" ]; then
        LC_ALL="$LANG"
    fi
    # if GDM_LANG isn't first in LANGUAGE, then unset it.
    if [ -n "$LANGUAGE" ]; then
        if echo "$LANGUAGE" | grep -q -- "^$GDM_LANG"; then
           :
        else
           unset LANGUAGE
        fi
    fi
fi
if [ "x$command" = "xcustom" ] ; then
  shift
  set -- default "$@"
fi
case "$1" in
  '' )
    # Should not ever happen, see failsafe above
  ;;
  default )
    # User chose "system default" session, which is default.
    # See if user has something more sensible in ~/.dmrc already.
    # I like perl, could use sed or "shell functions", instead.
    if [ -f $HOME/.dmrc ]; then
      dmrc=$(perl -ne 's/^\s*Session\s*=\s*(\/?\w[\w\/-]+)\s*$/$1/ and print,exit' $HOME/.dmrc)
      if [ -n "$dmrc" ]; then
        echo "$0: Using Session=$dmrc from ~/.dmrc instead of $1"
        shift
        set -- "$dmrc" "$@"
      else
        echo "$0: No Session=... line in ~/.dmrc so keep using $1"
      fi
    else
      echo "$0: No file ~/.dmrc so keep using $1"
    fi
  ;;
  * )
    # Got some (non-trivial?) session selection, record it in ~/.dmrc
    # in standard format
    echo -e "[Desktop]\nSession=$1" > $HOME/.dmrc
    echo "$0: Recorded Session=$1 in ~/.dmrc"
  ;;
esac
SESSIONFILES=$(run_parts $SYSSESSIONDIR)
if [ -n "$SESSIONFILES" ]; then
  for SESSIONFILE in $SESSIONFILES; do
    . $SESSIONFILE
  done
fi
echo "$0: Executing $command failed, will try to run x-terminal-emulator"
if [ -n "$zenity" ] ; then
        "$zenity" --info --text "I could not start your session and so I have started the failsafe xterm session.  Windows now have focus only if you have your cursor above them.  To get out of this mode type 'exit' in the window in the upper left corner"
fi
exec x-terminal-emulator -geometry 80x24+0+0

/etc/gdm3/daemon.conf changed:
[daemon]
[security]
DisallowTCP=false
[xdmcp]
Enable=true
HonorIndirect=true
MaxPending=4
MaxPendingIndirect=128
MaxSessions=128
MaxWait=30
MaxWaitIndirect=30
DisplaysPerHost=1
Port=177
[greeter]
[chooser]
[debug]

/etc/gdm3/greeter.gsettings changed:
[org.gnome.desktop.background]
picture-uri='file:///usr/share/images/desktop-base/moreblue-orbit-wallpaper-widescreen.svg'
picture-options='zoom'
[org.gnome.login-screen]
logo='/usr/share/icons/gnome/48x48/places/debian-swirl.png'
fallback-logo='/usr/share/icons/gnome/48x48/places/debian-swirl.png'
disable-user-list=true
[org.gnome.desktop.sound]
event-sounds=false
[org.gnome.metacity]
compositing-manager=false

/etc/pam.d/gdm3 changed:
auth    requisite       pam_nologin.so
@include common-auth
auth    optional        pam_gnome_keyring.so
@include common-account
session [success=ok ignore=ignore module_unknown=ignore default=bad]        pam_selinux.so close
session required        pam_limits.so
session required        pam_env.so readenv=1
session required        pam_env.so readenv=1 envfile=/etc/default/locale
session required        pam_loginuid.so
@include common-session
session [success=ok ignore=ignore module_unknown=ignore default=bad]        pam_selinux.so open
session optional        pam_gnome_keyring.so auto_start
@include common-password


-- debconf information:
* shared/default-x-display-manager: gdm3
  gdm3/daemon_name: /usr/sbin/gdm3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gdm-utmp-patch
Type: text/x-diff
Size: 4718 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20121011/bc90a05d/attachment.diff>


More information about the pkg-gnome-maintainers mailing list