Skip to content

Commit

Permalink
IMA: fix audit res field to indicate 1 for success and 0 for failure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Paris authored and James Morris committed Feb 16, 2012
1 parent bf06189 commit b0d5de4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion security/integrity/ima/ima_audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 1 addition & 1 deletion security/integrity/ima/ima_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b0d5de4

Please sign in to comment.