core/execute: serialize fd_names only if there're fds to pass
This commit is contained in:
@@ -1105,11 +1105,11 @@ static int exec_parameters_serialize(const ExecParameters *p, const ExecContext
|
||||
r = serialize_fd_many(f, fds, "exec-parameters-fds", p->fds, p->n_socket_fds + p->n_storage_fds + p->n_extra_fds);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
r = serialize_strv(f, "exec-parameters-fd-names", p->fd_names);
|
||||
if (r < 0)
|
||||
return r;
|
||||
r = serialize_strv(f, "exec-parameters-fd-names", p->fd_names);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
if (p->flags != 0) {
|
||||
r = serialize_item_format(f, "exec-parameters-flags", "%u", (unsigned) p->flags);
|
||||
|
||||
+1
-1
@@ -487,7 +487,7 @@ int exec_spawn(
|
||||
assert(context);
|
||||
assert(params);
|
||||
assert(!params->fds || FLAGS_SET(params->flags, EXEC_PASS_FDS));
|
||||
assert(params->fds || (params->n_socket_fds + params->n_storage_fds + params->n_extra_fds == 0));
|
||||
assert(params->fds || (params->n_socket_fds + params->n_storage_fds + params->n_extra_fds == 0 && !params->fd_names));
|
||||
assert(!params->files_env); /* We fill this field, ensure it comes NULL-initialized to us */
|
||||
assert(ret);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user