]> granicus.if.org Git - sudo/commitdiff
Work around a problem on Mac OS X 10.10 which defines AUE_sudo but
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 26 Apr 2015 01:44:52 +0000 (19:44 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 26 Apr 2015 01:44:52 +0000 (19:44 -0600)
where au_preselect() only accepts AUE_DARWIN_sudo (the old value).

plugins/sudoers/bsm_audit.c

index 7349b7b52eea080e6b0bb126a972524240603bb3..ef0a0e1756427f3d49050d662b44d486b177700e 100644 (file)
 # define AUDIT_NOT_CONFIGURED  ENOSYS
 #endif
 
+/*
+ * Darwin defines AUE_sudo but au_preselect() only accepts AUE_DARWIN_sudo.
+ */
+#if defined(__APPLE__) && defined(AUE_DARWIN_sudo)
+# undef AUE_sudo
+# define AUE_sudo AUE_DARWIN_sudo
+#endif
+
 static int
 audit_sudo_selected(int sorf)
 {
@@ -68,6 +76,8 @@ audit_sudo_selected(int sorf)
                mask = &ainfo_addr.ai_mask;
        }
        rc = au_preselect(AUE_sudo, mask, sorf, AU_PRS_REREAD);
+       if (rc == -1)
+               sudo_warn("au_preselect");
         debug_return_int(rc);
 }