summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2015-09-30 09:29:00 +1300
committerRobert Ancell <robert.ancell@canonical.com>2015-09-30 09:29:00 +1300
commita41e506655c97860d29927d8a507f63de7ec7e57 (patch)
tree9b80650deaac7cf19113098a201f47b4d7f3ce94
parent8126134a5af5ad624a649399d484b2af0a872158 (diff)
downloadlightdm-git-a41e506655c97860d29927d8a507f63de7ec7e57.tar.gz
Fix compilation without libaudit installed
-rw-r--r--src/session-child.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/session-child.c b/src/session-child.c
index d8de5c2d..f673b395 100644
--- a/src/session-child.c
+++ b/src/session-child.c
@@ -224,10 +224,10 @@ updwtmpx (const gchar *wtmp_file, struct utmpx *ut)
updwtmp (wtmp_file, &u);
}
+#if HAVE_LIBAUDIT
static void
audit_event (int type, const gchar *username, uid_t uid, const gchar *remote_host_name, const gchar *tty, gboolean success)
{
-#if HAVE_LIBAUDIT
int auditfd, result;
const char *op = NULL;
@@ -247,8 +247,8 @@ audit_event (int type, const gchar *username, uid_t uid, const gchar *remote_hos
g_printerr ("Error writing audit message: %s\n", strerror (errno));
close (auditfd);
-#endif
}
+#endif
int
session_child_run (int argc, char **argv)
@@ -417,7 +417,9 @@ session_child_run (int argc, char **argv)
updwtmpx ("/var/log/btmp", &ut);
+#if HAVE_LIBAUDIT
audit_event (AUDIT_USER_LOGIN, username, -1, remote_host_name, tty, FALSE);
+#endif
}
/* Check account is valid */
@@ -734,7 +736,9 @@ session_child_run (int argc, char **argv)
endutxent ();
updwtmpx ("/var/log/wtmp", &ut);
+#if HAVE_LIBAUDIT
audit_event (AUDIT_USER_LOGIN, username, uid, remote_host_name, tty, TRUE);
+#endif
}
waitpid (child_pid, &return_code, 0);
@@ -772,7 +776,9 @@ session_child_run (int argc, char **argv)
endutxent ();
updwtmpx ("/var/log/wtmp", &ut);
+#if HAVE_LIBAUDIT
audit_event (AUDIT_USER_LOGOUT, username, uid, remote_host_name, tty, TRUE);
+#endif
}
}