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
--- a/src/session-child.c
+++ b/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;
@@ -422,6 +427,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
@@ -726,6 +733,7 @@ session_child_run (int argc, char **argv
{
int child_status;
+#if 0
/* Log to utmp */
if (g_strcmp0 (pam_getenv (pam_handle, "XDG_SESSION_CLASS"), "greeter") != 0)
{
@@ -759,14 +767,14 @@ session_child_run (int argc, char **argv
audit_event (AUDIT_USER_LOGIN, username, uid, remote_host_name, tty, TRUE);
#endif
}
-
+#endif
waitpid (child_pid, &child_status, 0);
child_pid = 0;
if (WIFEXITED (child_status))
return_code = WEXITSTATUS (child_status);
else
return_code = EXIT_FAILURE;
-
+#if 0
/* Log to utmp */
if (g_strcmp0 (pam_getenv (pam_handle, "XDG_SESSION_CLASS"), "greeter") != 0)
{
@@ -800,6 +808,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 */