Assorted fixes (#40987)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user