summaryrefslogtreecommitdiff
path: root/src/timedate
diff options
context:
space:
mode:
Diffstat (limited to 'src/timedate')
-rw-r--r--src/timedate/timedatectl.c4
-rw-r--r--src/timedate/timedated.c10
2 files changed, 9 insertions, 5 deletions
diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c
index 6e0bc3cf83..9b81513c75 100644
--- a/src/timedate/timedatectl.c
+++ b/src/timedate/timedatectl.c
@@ -214,8 +214,10 @@ static int show_status(sd_bus *bus, char **args, unsigned n) {
"/org/freedesktop/timedate1",
map,
&info);
- if (r < 0)
+ if (r < 0) {
+ log_error("Failed to query server: %s", strerror(-r));
goto fail;
+ }
print_status_info(&info);
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
index 0641f39551..6d4388c70c 100644
--- a/src/timedate/timedated.c
+++ b/src/timedate/timedated.c
@@ -750,6 +750,8 @@ static int method_set_ntp(sd_bus *bus, sd_bus_message *m, void *userdata, sd_bus
return sd_bus_reply_method_return(m, NULL);
}
+#include <sys/capability.h>
+
static const sd_bus_vtable timedate_vtable[] = {
SD_BUS_VTABLE_START(0),
SD_BUS_PROPERTY("Timezone", "s", NULL, offsetof(Context, zone), SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE),
@@ -759,10 +761,10 @@ static const sd_bus_vtable timedate_vtable[] = {
SD_BUS_PROPERTY("NTPSynchronized", "b", property_get_ntp_sync, 0, 0),
SD_BUS_PROPERTY("TimeUSec", "t", property_get_time, 0, 0),
SD_BUS_PROPERTY("RTCTimeUSec", "t", property_get_rtc_time, 0, 0),
- SD_BUS_METHOD("SetTime", "xbb", NULL, method_set_time, 0),
- SD_BUS_METHOD("SetTimezone", "sb", NULL, method_set_timezone, 0),
- SD_BUS_METHOD("SetLocalRTC", "bbb", NULL, method_set_local_rtc, 0),
- SD_BUS_METHOD("SetNTP", "bb", NULL, method_set_ntp, 0),
+ SD_BUS_METHOD("SetTime", "xbb", NULL, method_set_time, SD_BUS_VTABLE_UNPRIVILEGED),
+ SD_BUS_METHOD("SetTimezone", "sb", NULL, method_set_timezone, SD_BUS_VTABLE_UNPRIVILEGED),
+ SD_BUS_METHOD("SetLocalRTC", "bbb", NULL, method_set_local_rtc, SD_BUS_VTABLE_UNPRIVILEGED),
+ SD_BUS_METHOD("SetNTP", "bb", NULL, method_set_ntp, SD_BUS_VTABLE_UNPRIVILEGED),
SD_BUS_VTABLE_END,
};