summaryrefslogtreecommitdiffstats
path: root/src/core/manager-serialize.c
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-07-23 17:55:12 +0200
committerMike Yuan <me@yhndnzj.com>2024-07-23 19:38:57 +0200
commitd4e5c66ed469c822ca5346c7a445ec1446b1d17f (patch)
treebc2295d186f2407c9ef13b72a21d11b77768fae4 /src/core/manager-serialize.c
parentcore: clean up Set/LoadCredential= parsers (diff)
downloadsystemd-d4e5c66ed469c822ca5346c7a445ec1446b1d17f.tar.xz
systemd-d4e5c66ed469c822ca5346c7a445ec1446b1d17f.zip
core: reliably check if varlink socket has been deserialized
Follow-up for 6906c028e83b77b35eaaf87b27d0fe5c6e1984b7 The mentioned commit uses access() to check if varlink socket already exists in the filesystem, but that isn't sufficient. > Varlink sockets are not serialized until v252, so upgrading from > v251 or older means we will not listen anymore on the varlink sockets. > > See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1074789 > for more details as this was found when updating from Debian Bullseye to a new version. After this commit, the set up of varlink_server is effectively split into two steps. manager_varlink_init_system(), which is called after deserialization, would no longer skip listening even if Manager.varlink_server is in place, but actually check if we're listening on desired sockets. Then, manager_deserialize() can be switched back to using manager_setup_varlink_server(). Alternative to #33817 Co-authored-by: Luca Boccassi <bluca@debian.org>
Diffstat (limited to 'src/core/manager-serialize.c')
-rw-r--r--src/core/manager-serialize.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/manager-serialize.c b/src/core/manager-serialize.c
index 8d998d40c1..62dfce93a0 100644
--- a/src/core/manager-serialize.c
+++ b/src/core/manager-serialize.c
@@ -508,7 +508,7 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
return r;
} else if ((val = startswith(l, "varlink-server-socket-address="))) {
if (!m->varlink_server && MANAGER_IS_SYSTEM(m)) {
- r = manager_varlink_init(m);
+ r = manager_setup_varlink_server(m);
if (r < 0) {
log_warning_errno(r, "Failed to setup varlink server, ignoring: %m");
continue;