diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-08-27 19:28:19 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-08-27 19:49:09 +0200 |
commit | fd73184f25d85506aa7ad51993921a39e6cbba74 (patch) | |
tree | 8342fbfba253b14e3df9d65ee1c3b45cd43d4a78 /src/resolve | |
parent | 52aaef0f5dc81b9a08d720f551eac53ac88aa596 (diff) | |
download | systemd-fd73184f25d85506aa7ad51993921a39e6cbba74.tar.gz |
resolved: query polkit only after parsing the data
That's what we do everywhere else because it leads to nicer user experience.
Diffstat (limited to 'src/resolve')
-rw-r--r-- | src/resolve/resolved-bus.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/resolve/resolved-bus.c b/src/resolve/resolved-bus.c index 924242fe6c..db0f8381ef 100644 --- a/src/resolve/resolved-bus.c +++ b/src/resolve/resolved-bus.c @@ -1638,15 +1638,6 @@ static int bus_method_register_service(sd_bus_message *message, void *userdata, if (m->mdns_support != RESOLVE_SUPPORT_YES) return sd_bus_error_setf(error, SD_BUS_ERROR_NOT_SUPPORTED, "Support for MulticastDNS is disabled"); - r = bus_verify_polkit_async(message, CAP_SYS_ADMIN, - "org.freedesktop.resolve1.register-service", - NULL, false, UID_INVALID, - &m->polkit_registry, error); - if (r < 0) - return r; - if (r == 0) - return 1; /* Polkit will call us back */ - service = new0(DnssdService, 1); if (!service) return log_oom(); @@ -1771,6 +1762,15 @@ static int bus_method_register_service(sd_bus_message *message, void *userdata, if (r < 0) return r; + r = bus_verify_polkit_async(message, CAP_SYS_ADMIN, + "org.freedesktop.resolve1.register-service", + NULL, false, UID_INVALID, + &m->polkit_registry, error); + if (r < 0) + return r; + if (r == 0) + return 1; /* Polkit will call us back */ + r = hashmap_ensure_allocated(&m->dnssd_services, &string_hash_ops); if (r < 0) return r; |