|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
From fb14f86a7188f289dfc4081a6d83a5c9c7ce5a81 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
Date: Sat, 21 Mar 2015 17:40:20 -0400
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
Subject: [PATCH] timedated: flip internal status after executing operation
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
timedated would set the internal status before calling out to systemd to do
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
the actual change. When the operation was refused because of a SELinux denial,
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
the state kept in timedated would get out of sync, and the second call from
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
timedatectl would appear to succeed.
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
https://bugzilla.redhat.com/show_bug.cgi?id=1014315
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
(cherry picked from commit 192b98b8fe73c8fb4bb3d6540deb93f5fb6eb9d2)
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
---
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
src/timedate/timedated.c | 4 ++--
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
index 753c3d1d65..bee66af24a 100644
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
--- a/src/timedate/timedated.c
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
+++ b/src/timedate/timedated.c
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
@@ -609,8 +609,6 @@ static int method_set_ntp(sd_bus *bus, sd_bus_message *m, void *userdata, sd_bus
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
if (r == 0)
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
return 1;
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
- c->use_ntp = ntp;
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
-
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
r = context_enable_ntp(c, bus, error);
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
return r;
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
@@ -619,6 +617,8 @@ static int method_set_ntp(sd_bus *bus, sd_bus_message *m, void *userdata, sd_bus
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
return r;
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
+ c->use_ntp = ntp;
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
+
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
log_info("Set NTP to %s", c->use_ntp ? "enabled" : "disabled");
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
|
|
Zbigniew Jędrzejewski-Szmek |
77e6ed |
sd_bus_emit_properties_changed(bus, "/org/freedesktop/timedate1", "org.freedesktop.timedate1", "NTP", NULL);
|