[LightDM] lightdm-1.16.2 fails to build if audit is not installed

Joakim Tjernlund joakim.tjernlund at transmode.se
Mon Oct 5 10:03:11 PDT 2015


A few places are missing #if HAVE_LIBAUDIT wrapped around them.
This patch fixes the build.

--- src/session-child.c.org	2015-10-01 20:51:35.830722781 +0200
+++ src/session-child.c	2015-10-01 20:54:09.539968600 +0200
@@ -416,8 +416,9 @@
             ut.ut_tv.tv_usec = tv.tv_usec;
 
             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 */
@@ -733,8 +734,9 @@
                 g_printerr ("Failed to write utmpx: %s\n", strerror (errno));
             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);
@@ -771,8 +773,9 @@
                 g_printerr ("Failed to write utmpx: %s\n", strerror (errno));
             endutxent ();
             updwtmpx ("/var/log/wtmp", &ut);
-
+#if HAVE_LIBAUDIT
             audit_event (AUDIT_USER_LOGOUT, username, uid, remote_host_name, tty, TRUE);
+#endif
         }
     }
 


More information about the LightDM mailing list