diff --git a/src/basic/namespace-util.c b/src/basic/namespace-util.c index fff518ef96..97ed3d268f 100644 --- a/src/basic/namespace-util.c +++ b/src/basic/namespace-util.c @@ -359,7 +359,7 @@ int is_our_namespace(int fd, NamespaceType type) { int r; assert(fd >= 0); - assert(type < _NAMESPACE_TYPE_MAX); + assert(type >= 0 && type < _NAMESPACE_TYPE_MAX); r = fd_is_namespace(fd, type); if (r < 0) diff --git a/src/core/execute-serialize.c b/src/core/execute-serialize.c index 953b0d9894..55a5216042 100644 --- a/src/core/execute-serialize.c +++ b/src/core/execute-serialize.c @@ -3278,7 +3278,7 @@ static int exec_context_deserialize(ExecContext *c, FILE *f) { r = extract_first_word(&val, &options, NULL, EXTRACT_UNQUOTE); if (r < 0) - return -r; + return r; if (isempty(options) || streq(options, "rbind")) rbind = true; @@ -3337,7 +3337,7 @@ static int exec_context_deserialize(ExecContext *c, FILE *f) { r = extract_first_word(&val, &options, NULL, EXTRACT_UNQUOTE); if (r < 0) - return -r; + return r; if (isempty(options) || streq(options, "rbind")) rbind = true; diff --git a/src/core/manager.c b/src/core/manager.c index bb8a735683..971f01903c 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -1679,6 +1679,7 @@ static void manager_clear_jobs_and_units(Manager *m) { assert(!m->start_when_upheld_queue); assert(!m->stop_when_bound_queue); assert(!m->release_resources_queue); + assert(!m->stop_notify_queue); assert(hashmap_isempty(m->jobs)); assert(hashmap_isempty(m->units)); diff --git a/src/core/unit.c b/src/core/unit.c index 35691363e0..2205ad0e2b 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -4345,10 +4345,13 @@ static int unit_verify_contexts(const Unit *u) { return log_unit_error_errno(u, SYNTHETIC_ERRNO(ENOEXEC), "PrivatePIDs= setting is only supported for service units. Refusing."); if ((ec->user || ec->dynamic_user || ec->group || ec->pam_name) && ec->private_users == PRIVATE_USERS_MANAGED) - return log_unit_error_errno(u, SYNTHETIC_ERRNO(ENOEXEC), "PrivateUsers=managed may not be used in combination with User=/DynamicUser=/Group=/PAMName=, refusing."); + return log_unit_error_errno(u, SYNTHETIC_ERRNO(ENOEXEC), "PrivateUsers=managed may not be used in combination with User=/DynamicUser=/Group=/PAMName=. Refusing."); if (ec->user_namespace_path && ec->private_users != PRIVATE_USERS_NO) - return log_unit_error_errno(u, SYNTHETIC_ERRNO(ENOEXEC), "PrivateUsers= may not be used with custom UserNamespacePath=, refusing."); + return log_unit_error_errno(u, SYNTHETIC_ERRNO(ENOEXEC), "PrivateUsers= may not be used with custom UserNamespacePath=. Refusing."); + + if (ec->private_pids != PRIVATE_PIDS_NO && ec->pam_name) + return log_unit_error_errno(u, SYNTHETIC_ERRNO(ENOEXEC), "PAM is not supported under PrivatePIDs=. Refusing."); const KillContext *kc = unit_get_kill_context(u); diff --git a/src/libsystemd/sd-daemon/sd-daemon.c b/src/libsystemd/sd-daemon/sd-daemon.c index da5242c3b7..50bdcb1a23 100644 --- a/src/libsystemd/sd-daemon/sd-daemon.c +++ b/src/libsystemd/sd-daemon/sd-daemon.c @@ -637,8 +637,8 @@ static int pid_notify_with_fds_internal( } if (DEBUG_LOGGING) { - _cleanup_free_ char *escaped = xescape_full(state, "\"", /* console_width = */ SIZE_MAX, XESCAPE_8_BIT); - log_debug("Notify message sent to '%s': \"%s\"", e, escaped ?: state); + _cleanup_free_ char *escaped = shell_escape(state, "\""); + log_debug("Notify message sent to '%s': \"%s\"", e, strnull(escaped)); } return 1;