diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2015-09-30 09:27:32 +1300 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2015-09-30 09:27:32 +1300 |
commit | 9d83fd975503baae17b3e78f74f32e1a6eae1a49 (patch) | |
tree | c1651131c7d6c8ec7e65493371101f1315710d0e | |
parent | af088bd99d0baa4356d8b7e801a003d663e0aeb3 (diff) | |
download | lightdm-git-9d83fd975503baae17b3e78f74f32e1a6eae1a49.tar.gz |
Fix compilation without libaudit installed
-rw-r--r-- | src/session-child.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/session-child.c b/src/session-child.c index 7ea074b4..c5b5c211 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 } } |