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 p...@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" \ "<debia...@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
--- a/daemon/gdm-session-record.c 2012-09-07 04:33:20.000000000 +1000 +++ b/daemon/gdm-session-record.c 2012-10-11 13:20:34.000000000 +1100 @@ -124,20 +124,43 @@ } g_debug ("using ut_pid %d", (int) u->ut_pid); #endif } static void record_set_id (UTMP *u, const char *id) { #if defined(HAVE_UT_UT_ID) +/* PSz 11 Oct 12 + * Seems this record_set_id() is only ever called to set ID to $DISPLAY. + * + * For console logins, $DISPLAY may be ":0" and that might be a sensible ID. + * But for remote XDMCP clients, $DISPLAY is "IP.of.cli.ent:0" and that does + * not go well into a 4-byte ut_id, is likely to cause all the clients use + * the same ut_id of "192." + * + * It may be sensible to simply leave ut_id="" as then getutxid() will use + * ut_line to match, see sysdeps/generic/utmp-equal.h in libc sources. + * In fact we ourselves do such similar matching ourselves, ignoring ut_id, + * when "Updating existing utmp record". + * + * Another idea might be to encode session_pid into ut_id, say somewhat + * similarly to Samba ut_id_encode() in source/smbd/utmp.c . But I am lazy + * and go for the simple "leave blank". + * + * Based on previous patch for older version, see: + * http://bugs.debian.org/551802 + * https://bugzilla.gnome.org/show_bug.cgi?id=599103 + */ + return; +/* No need for return above, since record_set_id() is never called */ strncpy (u->ut_id, id, sizeof (u->ut_id)); g_debug ("using ut_id %.*s", (int) sizeof (u->ut_id), u->ut_id); #endif } static void record_set_host (UTMP *u, const char *x11_display_name, const char *host_name) { @@ -211,21 +234,22 @@ #if defined(HAVE_UT_UT_TYPE) session_record.ut_type = USER_PROCESS; g_debug ("using ut_type USER_PROCESS"); #endif record_set_timestamp (&session_record); record_set_pid (&session_record, session_pid); /* Set ut_id to the $DISPLAY value */ - record_set_id (&session_record, x11_display_name); + /* PSz 11 Oct 12 Do not set ut_id to $DISPLAY, but leave blank */ +/* record_set_id (&session_record, x11_display_name); */ record_set_host (&session_record, x11_display_name, host_name); record_set_line (&session_record, display_device, x11_display_name); /* Handle wtmp */ g_debug ("Writing wtmp session record to " GDM_NEW_SESSION_RECORDS_FILE); #if defined(HAVE_UPDWTMPX) updwtmpx (GDM_NEW_SESSION_RECORDS_FILE, &session_record); #elif defined(HAVE_UPDWTMP) updwtmp (GDM_NEW_SESSION_RECORDS_FILE, &session_record); #elif defined(HAVE_LOGWTMP) && defined(HAVE_UT_UT_HOST) @@ -279,21 +303,22 @@ g_debug ("Writing logout record"); #if defined(HAVE_UT_UT_TYPE) session_record.ut_type = DEAD_PROCESS; g_debug ("using ut_type DEAD_PROCESS"); #endif record_set_timestamp (&session_record); record_set_pid (&session_record, session_pid); /* Set ut_id to the $DISPLAY value */ - record_set_id (&session_record, x11_display_name); + /* PSz 11 Oct 12 Do not set ut_id to $DISPLAY, but leave blank */ +/* record_set_id (&session_record, x11_display_name); */ record_set_host (&session_record, x11_display_name, host_name); record_set_line (&session_record, display_device, x11_display_name); /* Handle wtmp */ g_debug ("Writing wtmp logout record to " GDM_NEW_SESSION_RECORDS_FILE); #if defined(HAVE_UPDWTMPX) updwtmpx (GDM_NEW_SESSION_RECORDS_FILE, &session_record); #elif defined (HAVE_UPDWTMP) updwtmp (GDM_NEW_SESSION_RECORDS_FILE, &session_record); @@ -352,21 +377,22 @@ g_debug ("Writing failed session attempt record"); #if defined(HAVE_UT_UT_TYPE) session_record.ut_type = USER_PROCESS; g_debug ("using ut_type USER_PROCESS"); #endif record_set_timestamp (&session_record); record_set_pid (&session_record, session_pid); /* Set ut_id to the $DISPLAY value */ - record_set_id (&session_record, x11_display_name); + /* PSz 11 Oct 12 Do not set ut_id to $DISPLAY, but leave blank */ +/* record_set_id (&session_record, x11_display_name); */ record_set_host (&session_record, x11_display_name, host_name); record_set_line (&session_record, display_device, x11_display_name); /* Handle btmp */ g_debug ("Writing btmp failed session attempt record to " GDM_BAD_SESSION_RECORDS_FILE); #if defined(HAVE_UPDWTMPX) updwtmpx (GDM_BAD_SESSION_RECORDS_FILE, &session_record); #elif defined(HAVE_UPDWTMP)