diff options
author | Daniel Mack <daniel@zonque.org> | 2022-02-24 15:47:35 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-04-09 10:23:14 +0900 |
commit | 57b82eaacaf52b8333ae811cdd1b5445453ebb05 (patch) | |
tree | c0c6b471a9a3c3deeef94c050732cbba577e9304 /src/timesync/timesyncd-server.c | |
parent | f1b42a0b233e2c711184d93e14550dda76aedb9a (diff) | |
download | systemd-57b82eaacaf52b8333ae811cdd1b5445453ebb05.tar.gz |
timesyncd: add RUNTIME servers
This new server type can only be set at runtime through a D-Bus method
and is exposed for reading through a D-Bus property.
`CAP_NET_ADMIN` and a PolKit acknowledge is required for setting
runtime servers.
Entries submitted that way are used before system and link servers
are being looked at.
Diffstat (limited to 'src/timesync/timesyncd-server.c')
-rw-r--r-- | src/timesync/timesyncd-server.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/timesync/timesyncd-server.c b/src/timesync/timesyncd-server.c index dd16891734..002a6117cc 100644 --- a/src/timesync/timesyncd-server.c +++ b/src/timesync/timesyncd-server.c @@ -85,6 +85,9 @@ int server_name_new( } else if (type == SERVER_FALLBACK) { LIST_FIND_TAIL(names, m->fallback_servers, tail); LIST_INSERT_AFTER(names, m->fallback_servers, tail, n); + } else if (type == SERVER_RUNTIME) { + LIST_FIND_TAIL(names, m->runtime_servers, tail); + LIST_INSERT_AFTER(names, m->runtime_servers, tail, n); } else assert_not_reached(); @@ -114,6 +117,8 @@ ServerName *server_name_free(ServerName *n) { LIST_REMOVE(names, n->manager->link_servers, n); else if (n->type == SERVER_FALLBACK) LIST_REMOVE(names, n->manager->fallback_servers, n); + else if (n->type == SERVER_RUNTIME) + LIST_REMOVE(names, n->manager->runtime_servers, n); else assert_not_reached(); |