components/sudo/patches/audit-event.patch
changeset 447 7ca7b95abd2f
child 797 ef9656f77cca
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/sudo/patches/audit-event.patch	Mon Aug 01 12:41:59 2011 -0700
@@ -0,0 +1,60 @@
+--- sudo-1.8.1p2/plugins/sudoers/bsm_audit.c	Wed Mar 16 10:40:56 2011
++++ sudo-1.8.1p2-fixes/plugins/sudoers/bsm_audit.c	Mon Aug  1 03:40:43 2011
+@@ -31,6 +31,7 @@
+ #include <unistd.h>
+ 
+ #include "bsm_audit.h"
++#define	AUE_sudo 6650
+ 
+ /*
+  * Solaris auditon() returns EINVAL if BSM audit not configured.
+@@ -100,7 +101,7 @@
+ 		log_error(0, "au_open: failed");
+ 	if (getaudit_addr(&ainfo_addr, sizeof(ainfo_addr)) == 0) {
+ 		tok = au_to_subject_ex(auid, geteuid(), getegid(), getuid(),
+-		    getuid(), pid, pid, &ainfo_addr.ai_termid);
++		    getuid(), pid, &ainfo_addr.ai_asid, &ainfo_addr.ai_termid);
+ 	} else if (errno == ENOSYS) {
+ 		/*
+ 		 * NB: We should probably watch out for ERANGE here.
+@@ -108,7 +109,7 @@
+ 		if (getaudit(&ainfo) < 0)
+ 			log_error(0, "getaudit: failed");
+ 		tok = au_to_subject(auid, geteuid(), getegid(), getuid(),
+-		    getuid(), pid, pid, &ainfo.ai_termid);
++		    getuid(), pid, &ainfo.ai_asid, &ainfo.ai_termid);
+ 	} else
+ 		log_error(0, "getaudit: failed");
+ 	if (tok == NULL)
+@@ -122,7 +123,7 @@
+ 	if (tok == NULL)
+ 		log_error(0, "au_to_return32: failed");
+ 	au_write(aufd, tok);
+-	if (au_close(aufd, 1, AUE_sudo) == -1)
++	if (au_close(aufd, 1, AUE_sudo, 0) == -1)
+ 		log_error(0, "unable to commit audit record");
+ }
+ 
+@@ -157,12 +158,12 @@
+ 		log_error(0, "au_open: failed");
+ 	if (getaudit_addr(&ainfo_addr, sizeof(ainfo_addr)) == 0) { 
+ 		tok = au_to_subject_ex(auid, geteuid(), getegid(), getuid(),
+-		    getuid(), pid, pid, &ainfo_addr.ai_termid);
++		    getuid(), pid, &ainfo_addr.ai_asid, &ainfo_addr.ai_termid);
+ 	} else if (errno == ENOSYS) {
+ 		if (getaudit(&ainfo) < 0) 
+ 			log_error(0, "getaudit: failed");
+ 		tok = au_to_subject(auid, geteuid(), getegid(), getuid(),
+-		    getuid(), pid, pid, &ainfo.ai_termid);
++		    getuid(), pid, &ainfo.ai_asid, &ainfo.ai_termid);
+ 	} else
+ 		log_error(0, "getaudit: failed");
+ 	if (tok == NULL)
+@@ -181,6 +182,6 @@
+ 	if (tok == NULL)
+ 		log_error(0, "au_to_return32: failed");
+ 	au_write(aufd, tok);
+-	if (au_close(aufd, 1, AUE_sudo) == -1)
++	if (au_close(aufd, 1, AUE_sudo, PAD_FAILURE) == -1)
+ 		log_error(0, "unable to commit audit record");
+ }