basic modification from way back
[powerpc.git] / net / netlabel / netlabel_user.c
index 98a4163..42f12bd 100644 (file)
 #include "netlabel_cipso_v4.h"
 #include "netlabel_user.h"
 
+/* do not do any auditing if audit_enabled == 0, see kernel/audit.c for
+ * details */
+extern int audit_enabled;
+
 /*
  * NetLabel NETLINK Setup Functions
  */
@@ -101,6 +105,9 @@ struct audit_buffer *netlbl_audit_start_common(int type,
        char *secctx;
        u32 secctx_len;
 
+       if (audit_enabled == 0)
+               return NULL;
+
        audit_buf = audit_log_start(audit_ctx, GFP_ATOMIC, type);
        if (audit_buf == NULL)
                return NULL;