|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
From d7215ee47b09ca190b2eadfe3af71f810cd94418 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
From: Lennart Poettering <lennart@poettering.net>
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
Date: Tue, 30 May 2017 14:49:35 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
Subject: [PATCH] timesyncd: properly handle OOM errors when parsing fallback
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
servers (#6047)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
(cherry picked from commit c4c069121cbd5f882ef2e7effba5cdd3673c0a1f)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
src/timesync/timesyncd.c | 6 +++++-
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
index 052329f61e..ff90f04070 100644
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
--- a/src/timesync/timesyncd.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+++ b/src/timesync/timesyncd.c
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
@@ -132,7 +132,11 @@ int main(int argc, char *argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
log_warning_errno(r, "Failed to parse configuration file: %m");
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
- assert_se(manager_parse_fallback_string(m, NTP_SERVERS) >= 0);
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+ r = manager_parse_fallback_string(m, NTP_SERVERS);
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+ if (r < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+ log_error_errno(r, "Failed to parse fallback server strings: %m");
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+ goto finish;
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
+ }
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
log_debug("systemd-timesyncd running as pid " PID_FMT, getpid());
|
|
Zbigniew Jędrzejewski-Szmek |
f4a676 |
sd_notify(false,
|