From: Eric Paris Date: Tue, 14 Feb 2012 22:11:07 +0000 (-0500) Subject: IMA: fix audit res field to indicate 1 for success and 0 for failure X-Git-Tag: MMI-PSA29.97-13-9~17247^2~16 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b0d5de4d58803bbcce2b8175a8dd21c559a3abc1;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git IMA: fix audit res field to indicate 1 for success and 0 for failure 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 Signed-off-by: Mimi Zohar Signed-off-by: James Morris --- diff --git a/security/integrity/ima/ima_audit.c b/security/integrity/ima/ima_audit.c index 2ad942fb1e23..21e96bf188df 100644 --- a/security/integrity/ima/ima_audit.c +++ b/security/integrity/ima/ima_audit.c @@ -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); } diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index 0fb643a9c916..d8edff209bf3 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c @@ -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; }