Discussion:
audit-userspace: auparse/lru.c sanity_check_queue() compile error with DEBUG
(too old to reply)
Mor, Omri
2017-12-18 01:19:14 UTC
Permalink
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.

Omri Mor
Steve Grubb
2017-12-18 17:34:49 UTC
Permalink
Post by Mor, Omri
sanity_check_queue() attempts to call msg(), which as far as I can
tell
Post by Mor, Omri
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.

-Steve
Mor, Omri
2017-12-19 19:49:08 UTC
Permalink
Post by Steve Grubb
Post by Mor, Omri
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
Steve Grubb
2017-12-20 21:19:42 UTC
Permalink
Post by Steve Grubb
Post by Mor, Omri
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(),
Yes, I see that now. Normally syslog is wrapped so that messages can be switched
between stderr and syslog depending on the needs. Its fixed again in git.

-Steve

Loading...