summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2015-09-30 09:26:33 +1300
committerRobert Ancell <robert.ancell@canonical.com>2015-09-30 09:26:33 +1300
commit6c2f8cab2c3f5538beb536c5a61cb953c5cd15fd (patch)
tree7d228621e6dabfdf5a20a01db0cacc395a8da584 /src
parent52693d3690ad333fc9d0d10e4290b780af01b175 (diff)
downloadlightdm-6c2f8cab2c3f5538beb536c5a61cb953c5cd15fd.tar.gz
Fix compilation without libaudit installed
Diffstat (limited to 'src')
-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 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
}
}