mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09:00
core/execute: check if EXEC_PASS_FDS is set if got exec_params.fds
Prompted by #31789 (specifically https://github.com/systemd/systemd/pull/31789#discussion_r1525267612)
This commit is contained in:
@@ -374,7 +374,8 @@ int exec_spawn(Unit *unit,
|
||||
assert(command);
|
||||
assert(context);
|
||||
assert(params);
|
||||
assert(params->fds || (params->n_socket_fds + params->n_storage_fds <= 0));
|
||||
assert(!params->fds || FLAGS_SET(params->flags, EXEC_PASS_FDS));
|
||||
assert(params->fds || (params->n_socket_fds + params->n_storage_fds == 0));
|
||||
assert(!params->files_env); /* We fill this field, ensure it comes NULL-initialized to us */
|
||||
assert(ret);
|
||||
|
||||
|
||||
@@ -1681,6 +1681,8 @@ static int service_spawn_internal(
|
||||
|
||||
exec_params.open_files = s->open_files;
|
||||
|
||||
exec_params.flags |= EXEC_PASS_FDS;
|
||||
|
||||
log_unit_debug(UNIT(s), "Passing %zu fds to service", exec_params.n_socket_fds + exec_params.n_storage_fds);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user