mirror of
https://github.com/systemd/systemd.git
synced 2025-03-06 00:58:29 +03:00
Merge pull request #31959 from YHNdnzj/execute-pass-fds
core/execute: check if EXEC_PASS_FDS is set if got exec_params.fds
This commit is contained in:
commit
18640f8211
@ -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);
|
||||
|
||||
|
@ -1409,10 +1409,9 @@ static int service_collect_fds(
|
||||
Socket *sock;
|
||||
int cn_fds;
|
||||
|
||||
if (u->type != UNIT_SOCKET)
|
||||
continue;
|
||||
|
||||
sock = SOCKET(u);
|
||||
if (!sock)
|
||||
continue;
|
||||
|
||||
cn_fds = socket_collect_fds(sock, &cfds);
|
||||
if (cn_fds < 0)
|
||||
@ -1682,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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user