IMA: fix audit res field to indicate 1 for success and 0 for failure
authorEric Paris <eparis@redhat.com>
Tue, 14 Feb 2012 22:11:07 +0000 (17:11 -0500)
committerJames Morris <jmorris@namei.org>
Thu, 16 Feb 2012 01:01:42 +0000 (12:01 +1100)
The audit res field ususally indicates success with a 1 and 0 for a
failure.  So make IMA do it the same way.

Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
security/integrity/ima/ima_audit.c
security/integrity/ima/ima_policy.c

index 2ad942fb1e236e694eb50538ac71a33a90e8d40a..21e96bf188dfcc12ff3b05226f3c7d83521dbc2b 100644 (file)
@@ -61,6 +61,6 @@ void integrity_audit_msg(int audit_msgno, struct inode *inode,
                audit_log_untrustedstring(ab, inode->i_sb->s_id);
                audit_log_format(ab, " ino=%lu", inode->i_ino);
        }
-       audit_log_format(ab, " res=%d", !result ? 0 : 1);
+       audit_log_format(ab, " res=%d", !result);
        audit_log_end(ab);
 }
index 0fb643a9c916228296462a65b80efe18d6a5af26..d8edff209bf3b2bfc4373fa15ef17d25b30b86ed 100644 (file)
@@ -418,7 +418,7 @@ static int ima_parse_rule(char *rule, struct ima_measure_rule_entry *entry)
        if (!result && (entry->action == UNKNOWN))
                result = -EINVAL;
 
-       audit_log_format(ab, "res=%d", !!result);
+       audit_log_format(ab, "res=%d", !result);
        audit_log_end(ab);
        return result;
 }