Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > a77a7a74489f9417dfcd53e647d0235f > files > 2

libsepol-1.15.2-2.el5.src.rpm

diff --exclude-from=exclude -N -u -r nsalibsepol/include/sepol/handle.h libsepol-1.15.2/include/sepol/handle.h
--- nsalibsepol/include/sepol/handle.h	2006-11-01 09:49:05.000000000 -0500
+++ libsepol-1.15.2/include/sepol/handle.h	2009-04-07 12:46:52.000000000 -0400
@@ -7,6 +7,10 @@
 /* Create and return a sepol handle. */
 sepol_handle_t *sepol_handle_create(void);
 
+/* Set whether or not to disable dontaudits, 0 is default and does 
+ * not disable dontaudits, 1 disables them */
+void sepol_set_disable_dontaudit(sepol_handle_t * sh, int disable_dontaudit);
+
 /* Destroy a sepol handle. */
 void sepol_handle_destroy(sepol_handle_t *);
 
diff --exclude-from=exclude -N -u -r nsalibsepol/src/expand.c libsepol-1.15.2/src/expand.c
--- nsalibsepol/src/expand.c	2006-11-01 09:49:04.000000000 -0500
+++ libsepol-1.15.2/src/expand.c	2009-04-07 12:42:53.000000000 -0400
@@ -1362,6 +1362,8 @@
 	} else if (specified & AVRULE_AUDITDENY) {
 		spec = AVTAB_AUDITDENY;
 	} else if (specified & AVRULE_DONTAUDIT) {
+		if (handle && handle->disable_dontaudit)
+			return EXPAND_RULE_SUCCESS;
 		spec = AVTAB_AUDITDENY;
 	} else if (specified & AVRULE_NEVERALLOW) {
 		spec = AVTAB_NEVERALLOW;
diff --exclude-from=exclude -N -u -r nsalibsepol/src/handle.c libsepol-1.15.2/src/handle.c
--- nsalibsepol/src/handle.c	2006-11-01 09:49:04.000000000 -0500
+++ libsepol-1.15.2/src/handle.c	2009-04-07 12:52:08.000000000 -0400
@@ -13,9 +13,17 @@
 	sh->msg_callback = sepol_msg_default_handler;
 	sh->msg_callback_arg = NULL;
 
+	/* by default do not disable dontaudits */
+	sh->disable_dontaudit = 0;
+
 	return sh;
 }
 
+void sepol_set_disable_dontaudit(sepol_handle_t * sh, int disable_dontaudit)
+{
+	sh->disable_dontaudit = disable_dontaudit;
+}
+
 void sepol_handle_destroy(sepol_handle_t * sh)
 {
 	free(sh);
diff --exclude-from=exclude -N -u -r nsalibsepol/src/handle.h libsepol-1.15.2/src/handle.h
--- nsalibsepol/src/handle.h	2006-11-01 09:49:04.000000000 -0500
+++ libsepol-1.15.2/src/handle.h	2009-04-07 08:40:16.000000000 -0400
@@ -14,6 +14,8 @@
 	void (*msg_callback) (void *varg,
 			      sepol_handle_t * handle, const char *fmt, ...);
 	void *msg_callback_arg;
+
+	int disable_dontaudit;
 };
 
 #endif
diff --exclude-from=exclude -N -u -r nsalibsepol/src/libsepol.map libsepol-1.15.2/src/libsepol.map
--- nsalibsepol/src/libsepol.map	2006-11-01 09:49:04.000000000 -0500
+++ libsepol-1.15.2/src/libsepol.map	2009-04-07 12:48:38.000000000 -0400
@@ -12,5 +12,6 @@
 	sepol_policydb_*; sepol_set_policydb_from_file; 
 	sepol_policy_kern_*;
 	sepol_policy_file_*;
+	sepol_set_disable_dontaudit;
   local: *;
 };