From dce0b28cf4821bc17820e97fd4474f840af825ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 12 Jul 2017 12:52:43 +0200 Subject: [PATCH] clock sync: drop untrusted_ prefix after validation, fix error msg --- qvm-tools/qvm-sync-clock | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qvm-tools/qvm-sync-clock b/qvm-tools/qvm-sync-clock index 866c56d8..6b7cb384 100755 --- a/qvm-tools/qvm-sync-clock +++ b/qvm-tools/qvm-sync-clock @@ -35,9 +35,10 @@ def main(): untrusted_date_out = untrusted_date_out.strip() if not re.match(r'^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\+00:?00$', untrusted_date_out): - sys.stderr.write('Invalid date received, aborting!') + sys.stderr.write('Invalid date received, aborting!\n') sys.exit(1) - subprocess.check_call(['date', '-u', '-Iseconds', '-s', untrusted_date_out], + date_out = untrusted_date_out + subprocess.check_call(['date', '-u', '-Iseconds', '-s', date_out], stdout=subprocess.DEVNULL) subprocess.check_call(['hwclock', '--systohc'], stdout=subprocess.DEVNULL)