Assorted fixes (#40987)

This commit is contained in:
Luca Boccassi
2026-06-13 18:24:54 +01:00
committed by GitHub
5 changed files with 11 additions and 7 deletions
+1 -1
View File
@@ -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)
+2 -2
View File
@@ -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;
+1
View File
@@ -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));
+5 -2
View File
@@ -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);
+2 -2
View File
@@ -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;