core/varlink: make sure we setup non-serialized varlink sockets
authorMike Yuan <me@yhndnzj.com>
Tue, 3 Oct 2023 12:20:55 +0000 (20:20 +0800)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 12 Oct 2023 22:11:56 +0000 (23:11 +0100)
commit6906c028e83b77b35eaaf87b27d0fe5c6e1984b7
tree355b9c41adb5bb34a0e447ff7bd6b9c9ca459ac2
parentc08bec1587e102dd0435969e422288d69431e92c
core/varlink: make sure we setup non-serialized varlink sockets

Before this PR, if m->varlink_server is not yet set up during
deserialization, we call manager_setup_varlink_server rather than
manager_varlink_init, the former of which doesn't setup varlink
addresses, but only binds to methods. This results in that
newly-added varlink addresses not getting created if deserialization
takes place.

Therefore, let's switch to manager_varlink_init, and add some
sanity checks to it in order to prevent listening on the same
address twice.

Fixes #29373

Replaces #29421
src/core/core-varlink.c
src/core/manager-serialize.c