File lightdm-disable-utmp-handling.patch of Package lightdm
# HG changeset patch
# Parent ce2ab1b9285a9408ec9673b555b398c2af18de62
disable utmp handling since this is handled in the Xstartup/Xreset scripts
Index: lightdm-1.17.3/src/session-child.c
===================================================================
--- lightdm-1.17.3.orig/src/session-child.c
+++ lightdm-1.17.3/src/session-child.c
@@ -13,8 +13,10 @@
#include <grp.h>
#include <glib.h>
#include <security/pam_appl.h>
+#if 0
#include <utmp.h>
#include <utmpx.h>
+#endif
#include <sys/mman.h>
#if HAVE_LIBAUDIT
@@ -202,6 +204,7 @@ read_xauth (void)
return x_authority_new (x_authority_family, x_authority_address, x_authority_address_length, x_authority_number, x_authority_name, x_authority_data, x_authority_data_length);
}
+#if 0
/* GNU provides this but we can't rely on that so let's make our own version */
static void
updwtmpx (const gchar *wtmp_file, struct utmpx *ut)
@@ -224,6 +227,7 @@ updwtmpx (const gchar *wtmp_file, struct
updwtmp (wtmp_file, &u);
}
+#endif
#if HAVE_LIBAUDIT
static void
@@ -401,6 +405,7 @@ session_child_run (int argc, char **argv
/* Write record to btmp database */
if (authentication_result == PAM_AUTH_ERR)
{
+#if 0
struct utmpx ut;
struct timeval tv;
@@ -425,6 +430,8 @@ session_child_run (int argc, char **argv
updwtmpx ("/var/log/btmp", &ut);
+
+#endif
#if HAVE_LIBAUDIT
audit_event (AUDIT_USER_LOGIN, username, -1, remote_host_name, tty, FALSE);
#endif
@@ -713,6 +720,7 @@ session_child_run (int argc, char **argv
/* Wait for the command to complete (blocks) */
if (child_pid > 0)
{
+#if 0
/* Log to utmp */
if (g_strcmp0 (pam_getenv (pam_handle, "XDG_SESSION_CLASS"), "greeter") != 0)
{
@@ -749,10 +757,10 @@ session_child_run (int argc, char **argv
audit_event (AUDIT_USER_LOGIN, username, uid, remote_host_name, tty, TRUE);
#endif
}
-
+#endif
waitpid (child_pid, &return_code, 0);
child_pid = 0;
-
+#if 0
/* Log to utmp */
if (g_strcmp0 (pam_getenv (pam_handle, "XDG_SESSION_CLASS"), "greeter") != 0)
{
@@ -789,6 +797,7 @@ session_child_run (int argc, char **argv
audit_event (AUDIT_USER_LOGOUT, username, uid, remote_host_name, tty, TRUE);
#endif
}
+#endif
}
/* Remove X authority */