@@ -82,10 +82,9 @@ bool use_audit(void) {
|
||||
fd = socket(AF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, NETLINK_AUDIT);
|
||||
if (fd < 0) {
|
||||
cached_use = !IN_SET(errno, EAFNOSUPPORT, EPROTONOSUPPORT, EPERM);
|
||||
if (errno == EPERM)
|
||||
log_debug_errno(errno, "Audit access prohibited, won't talk to audit");
|
||||
}
|
||||
else {
|
||||
if (!cached_use)
|
||||
log_debug_errno(errno, "Won't talk to audit: %m");
|
||||
} else {
|
||||
cached_use = true;
|
||||
safe_close(fd);
|
||||
}
|
||||
|
||||
@@ -301,8 +301,7 @@ int drop_privileges(uid_t uid, gid_t gid, uint64_t keep_capabilities) {
|
||||
if (prctl(PR_SET_KEEPCAPS, 1) < 0)
|
||||
return log_error_errno(errno, "Failed to enable keep capabilities flag: %m");
|
||||
|
||||
r = setresuid(uid, uid, uid);
|
||||
if (r < 0)
|
||||
if (setresuid(uid, uid, uid) < 0)
|
||||
return log_error_errno(errno, "Failed to change user ID: %m");
|
||||
|
||||
if (prctl(PR_SET_KEEPCAPS, 0) < 0)
|
||||
|
||||
+2
-3
@@ -686,9 +686,8 @@ int log_internalv_realm(
|
||||
if (_likely_(LOG_PRI(level) > log_max_level[realm]))
|
||||
return -error;
|
||||
|
||||
/* Make sure that %m maps to the specified error */
|
||||
if (error != 0)
|
||||
errno = error;
|
||||
/* Make sure that %m maps to the specified error (or "Success"). */
|
||||
errno = error;
|
||||
|
||||
(void) vsnprintf(buffer, sizeof buffer, format, ap);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user