diff --git a/gdm-2.16.0-wtmp.patch b/gdm-2.16.0-wtmp.patch index e8967aa..feb1a7d 100644 --- a/gdm-2.16.0-wtmp.patch +++ b/gdm-2.16.0-wtmp.patch @@ -1,98 +1,31 @@ ---- gdm-2.16.0/config/PreSession.in.wtmp 2006-04-26 21:06:05.000000000 -0400 -+++ gdm-2.16.0/config/PreSession.in 2006-10-15 20:05:45.000000000 -0400 -@@ -68,17 +68,4 @@ if [ "x$XSETROOT" != "x" ] ; then +diff -up gdm-2.18.4/config/PreSession.in.wtmp gdm-2.18.4/config/PreSession.in +--- gdm-2.18.4/config/PreSession.in.wtmp 2007-07-30 16:06:57.000000000 -0400 ++++ gdm-2.18.4/config/PreSession.in 2007-08-21 17:11:19.000000000 -0400 +@@ -68,17 +68,15 @@ if [ "x$XSETROOT" != "x" ] ; then "$XSETROOT" -cursor_name left_ptr -solid "$BACKCOLOR" fi - --SESSREG=`gdmwhich sessreg` --if [ "x$SESSREG" != "x" ] ; then -- # some output for easy debugging + SESSREG=`gdmwhich sessreg` + if [ "x$SESSREG" != "x" ] ; then + # some output for easy debugging - echo "$0: Registering your session with wtmp and utmp" - echo "$0: running: $SESSREG -a -w /var/log/wtmp -u /var/run/utmp -x \"$X_SERVERS\" -h \"$REMOTE_HOST\" -l \"$DISPLAY\" \"$USER\"" -- ++ echo "$0: Registering your session with utmp" ++ echo "$0: running: $SESSREG -a -u /var/run/utmp -x \"$X_SERVERS\" -h \"$REMOTE_HOST\" -l \"$DISPLAY\" \"$USER\"" + - exec "$SESSREG" -a -w /var/log/wtmp -u /var/run/utmp -x "$X_SERVERS" -h "$REMOTE_HOST" -l "$DISPLAY" "$USER" -- # this is not reached --fi -- ++ exec "$SESSREG" -a -u /var/run/utmp -x "$X_SERVERS" -h "$REMOTE_HOST" -l "$DISPLAY" "$USER" + # this is not reached + fi + -# some output for easy debugging -echo "$0: could not find the sessreg utility, cannot update wtmp and utmp" ++echo "$0: could not find the sessreg utility, cannot update utmp" exit 0 ---- gdm-2.16.0/daemon/slave.c.wtmp 2006-10-15 20:05:45.000000000 -0400 -+++ gdm-2.16.0/daemon/slave.c 2006-10-15 20:05:45.000000000 -0400 -@@ -4315,6 +4315,14 @@ gdm_slave_session_start (void) - g_free (language); - g_free (gnome_session); - -+ gdm_verify_write_record (d, -+ GDM_VERIFY_RECORD_TYPE_LOGIN, -+ pwent->pw_name, -+ d->name, -+ !d->attached? d->hostname : NULL, -+ pid); -+ -+ - gdm_slave_send_num (GDM_SOP_SESSPID, pid); - - gdm_sigchld_block_push (); -@@ -4363,6 +4371,17 @@ gdm_slave_session_start (void) - uid, gid); - } - -+ if ((pid != 0) && (d->last_sess_status != -1)) { -+ gdm_debug ("session '%d' exited with status '%d', recording logout", -+ pid, d->last_sess_status); -+ gdm_verify_write_record (d, -+ GDM_VERIFY_RECORD_TYPE_LOGOUT, -+ pwent->pw_name, -+ d->name, -+ !d->attached? d->hostname : NULL, -+ pid); -+ } -+ - gdm_slave_session_stop (pid != 0 /* run_post_session */, - FALSE /* no_shutdown_check */); - -@@ -4721,7 +4740,7 @@ gdm_slave_child_handler (int sig) - } - } else if (pid != 0 && pid == d->sesspid) { - d->sesspid = 0; -- if (WIFEXITED (status)) -+ if (WIFEXITED (status)) - d->last_sess_status = WEXITSTATUS (status); - else - d->last_sess_status = -1; ---- gdm-2.16.0/daemon/verify.h.wtmp 2005-11-03 19:51:21.000000000 -0500 -+++ gdm-2.16.0/daemon/verify.h 2006-10-15 20:05:45.000000000 -0400 -@@ -21,6 +21,12 @@ - - #include "gdm.h" - -+typedef enum { -+ GDM_VERIFY_RECORD_TYPE_LOGIN, -+ GDM_VERIFY_RECORD_TYPE_LOGOUT, -+ GDM_VERIFY_RECORD_TYPE_FAILED_ATTEMPT -+} GdmVerifyRecordType; -+ - /* If username is NULL, we ask, if local is FALSE, don't start - * the timed login timer */ - gchar *gdm_verify_user (GdmDisplay *d, -@@ -30,6 +36,13 @@ gchar *gdm_verify_user (GdmDisplay *d - void gdm_verify_cleanup (GdmDisplay *d); - void gdm_verify_check (void); - void gdm_verify_select_user (const char *user); -+void gdm_verify_write_record (GdmDisplay *d, -+ GdmVerifyRecordType record_type, -+ const gchar *username, -+ const gchar *console_name, -+ const gchar *host_name, -+ GPid pid); -+ - /* used in pam */ - gboolean gdm_verify_setup_env (GdmDisplay *d); - gboolean gdm_verify_setup_user (GdmDisplay *d, ---- gdm-2.16.0/daemon/verify-pam.c.wtmp 2006-10-15 20:05:45.000000000 -0400 -+++ gdm-2.16.0/daemon/verify-pam.c 2006-10-15 20:08:48.000000000 -0400 +diff -up gdm-2.18.4/daemon/verify-pam.c.wtmp gdm-2.18.4/daemon/verify-pam.c +--- gdm-2.18.4/daemon/verify-pam.c.wtmp 2007-08-21 17:10:07.000000000 -0400 ++++ gdm-2.18.4/daemon/verify-pam.c 2007-08-21 17:10:07.000000000 -0400 @@ -29,6 +29,7 @@ #ifdef sun #include @@ -116,7 +49,7 @@ /* Evil, but this way these things are passed to the child session */ static pam_handle_t *pamh = NULL; -@@ -417,6 +426,125 @@ gdm_verify_select_user (const char *user +@@ -422,6 +431,125 @@ gdm_verify_select_user (const char *user selected_user = g_strdup (user); } @@ -242,7 +175,7 @@ static const char * perhaps_translate_message (const char *msg) { -@@ -1173,6 +1301,12 @@ authenticate_again: +@@ -1232,6 +1360,12 @@ authenticate_again: * message from the PAM subsystem */ if ( ! error_msg_given && gdm_slave_action_pending ()) { @@ -253,5 +186,80 @@ + getpid ()); + /* I'm not sure yet if I should display this message for any other issues - heeten */ + /* at least AUTHINFO_UNAVAIL -- it's what user unknown is! */ if (pamerr == PAM_AUTH_ERR || - pamerr == PAM_USER_UNKNOWN) { +diff -up gdm-2.18.4/daemon/slave.c.wtmp gdm-2.18.4/daemon/slave.c +--- gdm-2.18.4/daemon/slave.c.wtmp 2007-08-21 17:10:07.000000000 -0400 ++++ gdm-2.18.4/daemon/slave.c 2007-08-21 17:10:07.000000000 -0400 +@@ -4446,6 +4446,14 @@ gdm_slave_session_start (void) + g_free (language); + g_free (gnome_session); + ++ gdm_verify_write_record (d, ++ GDM_VERIFY_RECORD_TYPE_LOGIN, ++ pwent->pw_name, ++ d->name, ++ !d->attached? d->hostname : NULL, ++ pid); ++ ++ + gdm_slave_send_num (GDM_SOP_SESSPID, pid); + + gdm_sigchld_block_push (); +@@ -4508,6 +4516,17 @@ gdm_slave_session_start (void) + } + #endif + ++ if ((pid != 0) && (d->last_sess_status != -1)) { ++ gdm_debug ("session '%d' exited with status '%d', recording logout", ++ pid, d->last_sess_status); ++ gdm_verify_write_record (d, ++ GDM_VERIFY_RECORD_TYPE_LOGOUT, ++ pwent->pw_name, ++ d->name, ++ !d->attached? d->hostname : NULL, ++ pid); ++ } ++ + gdm_slave_session_stop (pid != 0 /* run_post_session */, + FALSE /* no_shutdown_check */); + +@@ -4866,7 +4885,7 @@ gdm_slave_child_handler (int sig) + } + } else if (pid != 0 && pid == d->sesspid) { + d->sesspid = 0; +- if (WIFEXITED (status)) ++ if (WIFEXITED (status)) + d->last_sess_status = WEXITSTATUS (status); + else + d->last_sess_status = -1; +diff -up gdm-2.18.4/daemon/verify.h.wtmp gdm-2.18.4/daemon/verify.h +--- gdm-2.18.4/daemon/verify.h.wtmp 2007-07-30 16:06:57.000000000 -0400 ++++ gdm-2.18.4/daemon/verify.h 2007-08-21 17:10:07.000000000 -0400 +@@ -21,6 +21,12 @@ + + #include "gdm.h" + ++typedef enum { ++ GDM_VERIFY_RECORD_TYPE_LOGIN, ++ GDM_VERIFY_RECORD_TYPE_LOGOUT, ++ GDM_VERIFY_RECORD_TYPE_FAILED_ATTEMPT ++} GdmVerifyRecordType; ++ + /* If username is NULL, we ask, if local is FALSE, don't start + * the timed login timer */ + gchar *gdm_verify_user (GdmDisplay *d, +@@ -31,6 +37,13 @@ gchar *gdm_verify_user (GdmDisplay *d + void gdm_verify_cleanup (GdmDisplay *d); + void gdm_verify_check (void); + void gdm_verify_select_user (const char *user); ++void gdm_verify_write_record (GdmDisplay *d, ++ GdmVerifyRecordType record_type, ++ const gchar *username, ++ const gchar *console_name, ++ const gchar *host_name, ++ GPid pid); ++ + /* used in pam */ + gboolean gdm_verify_setup_env (GdmDisplay *d); + gboolean gdm_verify_setup_user (GdmDisplay *d, diff --git a/gdm.spec b/gdm.spec index ef3e0c7..7ddd5a1 100644 --- a/gdm.spec +++ b/gdm.spec @@ -17,7 +17,7 @@ Summary: The GNOME Display Manager Name: gdm Version: 2.18.4 -Release: 2%{?dist} +Release: 3%{?dist} Epoch: 1 License: LGPL/GPL Group: User Interface/X @@ -394,6 +394,9 @@ fi %{_datadir}/pixmaps/faces/extras/*.jpg %changelog +* Tue Aug 21 2007 Ray Strode - 1:2.18.4-3 +- write utmp entry at login (bug 247987) + * Fri Aug 17 2007 Ray Strode - 1:2.18.4-2 - Provide fix to upstream bug 457998 for Hans de Goede to test