Blame SOURCES/0129-timedated-flip-internal-status-after-executing-opera.patch

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