audit-userspace: auparse/lru.c sanity_check_queue() compile error with DEBUG
Mor, Omri
omrimor2 at illinois.edu
Tue Dec 19 19:49:08 UTC 2017
>> sanity_check_queue() attempts to call msg(), which as far as I can tell
>> isn’t defined. It appears that this should be syslog() or audit_msg()
>> instead.
>> This causes compilation failure when DEBUG is defined.
>
> Thanks for reporting this. The function name is now fixed in git.
On second look, I think it’s supposed to be syslog(), not audit_msg().
The rest of the code in auparse/lru.c calls syslog(),
and audit_msg() requires a `auparse_state_t *' parameter which the current code doesn’t supply.
This causes compile-time warnings and probably runtime errors later if sanity_check_queue() were to actually be run.
lru.c: In function ‘sanity_check_queue’:
lru.c:148:14: warning: passing argument 1 of ‘auparse_msg’ makes pointer from integer without a cast [-Wint-conversion]
audit_msg(LOG_DEBUG, "%s - corruption found %u", id, i);
^
In file included from lru.c:28:0:
private.h:34:6: note: expected ‘auparse_state_t * {aka struct opaque *}’ but argument is of type ‘int’
void auparse_msg(auparse_state_t *au, int priority, const char *fmt, ...)
^
lru.c:148:25: warning: passing argument 2 of ‘auparse_msg’ makes integer from pointer without a cast [-Wint-conversion]
audit_msg(LOG_DEBUG, "%s - corruption found %u", id, i);
^
In file included from lru.c:28:0:
private.h:34:6: note: expected ‘int’ but argument is of type ‘char *’
void auparse_msg(auparse_state_t *au, int priority, const char *fmt, ...)
Omri
More information about the Linux-audit
mailing list