On 3/24/23 11:32, Laszlo Ersek wrote:
(2) If we pass LISTEN_PID=xxx and LISTEN_FDS=1, and just "pass
through"
an *inherited* LISTEN_FDNAMES variable, then it will (in the general
case) confuse the nbd server that we start. Namely, if
LISTEN_FDNAMES has multiple colon-separated elements (more than 1),
or is the empty string (= 0 elements), then
sd_listen_fds_with_names() in the nbd server will fail the "n_names
!= n_fds" check, and return (-EINVAL). If LISTEN_FDNAMES happens to
have one element, then sd_listen_fds_with_names() will succeed, but
the returned name will confuse the nbd server.
... We might even consider this an existent (current) bug in libnbd, as
we don't do anything about LISTEN_FDNAMES at the moment.
Laszlo