summaryrefslogtreecommitdiffstats
path: root/src/timesync
diff options
context:
space:
mode:
Diffstat (limited to 'src/timesync')
-rw-r--r--src/timesync/meson.build3
-rw-r--r--src/timesync/timesyncd-bus.c10
-rw-r--r--src/timesync/timesyncd-conf.c9
-rw-r--r--src/timesync/timesyncd-manager.c2
-rw-r--r--src/timesync/timesyncd-manager.h3
-rw-r--r--src/timesync/timesyncd-server.h4
-rw-r--r--src/timesync/timesyncd.c2
-rw-r--r--src/timesync/wait-sync.c2
8 files changed, 19 insertions, 16 deletions
diff --git a/src/timesync/meson.build b/src/timesync/meson.build
index 6844480..d843ed7 100644
--- a/src/timesync/meson.build
+++ b/src/timesync/meson.build
@@ -21,8 +21,7 @@ if get_option('link-timesyncd-shared')
timesyncd_link_with = [libshared]
else
timesyncd_link_with = [libsystemd_static,
- libshared_static,
- libbasic_gcrypt]
+ libshared_static]
endif
libtimesyncd_core = static_library(
diff --git a/src/timesync/timesyncd-bus.c b/src/timesync/timesyncd-bus.c
index 7237080..d1d2a14 100644
--- a/src/timesync/timesyncd-bus.c
+++ b/src/timesync/timesyncd-bus.c
@@ -67,10 +67,12 @@ static int method_set_runtime_servers(sd_bus_message *message, void *userdata, s
return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid NTP server name or address, refusing: %s", *name);
}
- r = bus_verify_polkit_async(message, CAP_NET_ADMIN,
- "org.freedesktop.timesync1.set-runtime-servers",
- NULL, true, UID_INVALID,
- &m->polkit_registry, error);
+ r = bus_verify_polkit_async(
+ message,
+ "org.freedesktop.timesync1.set-runtime-servers",
+ /* details= */ NULL,
+ &m->polkit_registry,
+ error);
if (r < 0)
return r;
if (r == 0)
diff --git a/src/timesync/timesyncd-conf.c b/src/timesync/timesyncd-conf.c
index 9c0b6f7..4b1d4dd 100644
--- a/src/timesync/timesyncd-conf.c
+++ b/src/timesync/timesyncd-conf.c
@@ -102,9 +102,12 @@ int manager_parse_config_file(Manager *m) {
assert(m);
- r = config_parse_config_file("timesyncd.conf", "Time\0",
- config_item_perf_lookup, timesyncd_gperf_lookup,
- CONFIG_PARSE_WARN, m);
+ r = config_parse_standard_file_with_dropins(
+ "systemd/timesyncd.conf",
+ "Time\0",
+ config_item_perf_lookup, timesyncd_gperf_lookup,
+ CONFIG_PARSE_WARN,
+ /* userdata= */ m);
if (r < 0)
return r;
diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c
index 1998ba9..8e0eda0 100644
--- a/src/timesync/timesyncd-manager.c
+++ b/src/timesync/timesyncd-manager.c
@@ -956,7 +956,7 @@ Manager* manager_free(Manager *m) {
sd_bus_flush_close_unref(m->bus);
- bus_verify_polkit_async_registry_free(m->polkit_registry);
+ hashmap_free(m->polkit_registry);
return mfree(m);
}
diff --git a/src/timesync/timesyncd-manager.h b/src/timesync/timesyncd-manager.h
index f444787..027ec52 100644
--- a/src/timesync/timesyncd-manager.h
+++ b/src/timesync/timesyncd-manager.h
@@ -45,10 +45,9 @@ struct Manager {
LIST_HEAD(ServerName, runtime_servers);
LIST_HEAD(ServerName, fallback_servers);
- bool have_fallbacks:1;
-
RateLimit ratelimit;
bool exhausted_servers;
+ bool have_fallbacks;
/* network */
sd_event_source *network_event_source;
diff --git a/src/timesync/timesyncd-server.h b/src/timesync/timesyncd-server.h
index e22917a..a4b5637 100644
--- a/src/timesync/timesyncd-server.h
+++ b/src/timesync/timesyncd-server.h
@@ -30,11 +30,11 @@ struct ServerAddress {
struct ServerName {
Manager *manager;
+ bool marked;
+
ServerType type;
char *string;
- bool marked:1;
-
LIST_HEAD(ServerAddress, addresses);
LIST_FIELDS(ServerName, names);
};
diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c
index 1d8ebec..5c308a0 100644
--- a/src/timesync/timesyncd.c
+++ b/src/timesync/timesyncd.c
@@ -174,7 +174,7 @@ static int run(int argc, char *argv[]) {
return log_error_errno(r, "Failed to drop privileges: %m");
}
- assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGTERM, SIGINT, SIGRTMIN+18, -1) >= 0);
+ assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGTERM, SIGINT, SIGRTMIN+18) >= 0);
r = manager_new(&m);
if (r < 0)
diff --git a/src/timesync/wait-sync.c b/src/timesync/wait-sync.c
index 832e117..b6c167b 100644
--- a/src/timesync/wait-sync.c
+++ b/src/timesync/wait-sync.c
@@ -184,7 +184,7 @@ static int run(int argc, char * argv[]) {
};
int r;
- assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGTERM, SIGINT, -1) >= 0);
+ assert_se(sigprocmask_many(SIG_BLOCK, NULL, SIGTERM, SIGINT) >= 0);
r = sd_event_default(&event);
if (r < 0)