audit: Report suspicious O_CREAT usage
[sfrench/cifs-2.6.git] / kernel / audit.c
index da8dc0db5bd3c0a9625827b597bb91bac01de914..d75485aa25ff3f3faa704852e03ff509a47e9e8a 100644 (file)
@@ -2155,18 +2155,19 @@ void audit_log_task_info(struct audit_buffer *ab)
 EXPORT_SYMBOL(audit_log_task_info);
 
 /**
- * audit_log_link_denied - report a link restriction denial
- * @operation: specific link operation
+ * audit_log_path_denied - report a path restriction denial
+ * @type: audit message type (AUDIT_ANOM_LINK, AUDIT_ANOM_CREAT, etc)
+ * @operation: specific operation name
  */
-void audit_log_link_denied(const char *operation)
+void audit_log_path_denied(int type, const char *operation)
 {
        struct audit_buffer *ab;
 
        if (!audit_enabled || audit_dummy_context())
                return;
 
-       /* Generate AUDIT_ANOM_LINK with subject, operation, outcome. */
-       ab = audit_log_start(audit_context(), GFP_KERNEL, AUDIT_ANOM_LINK);
+       /* Generate log with subject, operation, outcome. */
+       ab = audit_log_start(audit_context(), GFP_KERNEL, type);
        if (!ab)
                return;
        audit_log_format(ab, "op=%s", operation);