systemd socker activation: check listener
activation.Listeners() can return an net.Listener array which contains nil entries if it cannot listen on the given fds. This can cause podman to panic so we should check the we have non nil net.Listener first. [NO NEW TESTS NEEDED] No idea how to reproduce this. Fixes #13911 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
13c6fd067c
commit
eb71712626
|
@ -79,6 +79,10 @@ func newServer(runtime *libpod.Runtime, listener net.Listener, opts entities.Ser
|
||||||
return nil, fmt.Errorf("wrong number of file descriptors for socket activation protocol (%d != 1)", len(listeners))
|
return nil, fmt.Errorf("wrong number of file descriptors for socket activation protocol (%d != 1)", len(listeners))
|
||||||
}
|
}
|
||||||
listener = listeners[0]
|
listener = listeners[0]
|
||||||
|
// note that activation.Listeners() return nil when it cannot listen on the fd (i.e. udp connection)
|
||||||
|
if listener == nil {
|
||||||
|
return nil, fmt.Errorf("unexpected fd received from systemd: cannot listen on it")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if opts.CorsHeaders == "" {
|
if opts.CorsHeaders == "" {
|
||||||
logrus.Debug("CORS Headers were not set")
|
logrus.Debug("CORS Headers were not set")
|
||||||
|
|
Loading…
Reference in New Issue