1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-28 11:55:23 +03:00

core: prefix selinux messages with "selinux: "

SELinux outputs semi-random messages like "Unknown permission start for class
system", and the user has to dig into message metadata to find out where
they are comming from. Add a prefix to give a hint.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2016-04-09 11:13:26 -04:00
parent 0c0ee5ebee
commit c8a806f2c0

View File

@ -110,6 +110,7 @@ static int callback_type_to_priority(int type) {
*/ */
_printf_(2, 3) static int log_callback(int type, const char *fmt, ...) { _printf_(2, 3) static int log_callback(int type, const char *fmt, ...) {
va_list ap; va_list ap;
const char *fmt2;
#ifdef HAVE_AUDIT #ifdef HAVE_AUDIT
int fd; int fd;
@ -131,8 +132,10 @@ _printf_(2, 3) static int log_callback(int type, const char *fmt, ...) {
} }
#endif #endif
fmt2 = strjoina("selinux: ", fmt);
va_start(ap, fmt); va_start(ap, fmt);
log_internalv(LOG_AUTH | callback_type_to_priority(type), 0, __FILE__, __LINE__, __FUNCTION__, fmt, ap); log_internalv(LOG_AUTH | callback_type_to_priority(type), 0, __FILE__, __LINE__, __FUNCTION__, fmt2, ap);
va_end(ap); va_end(ap);
return 0; return 0;