diff --git a/backport-check-for-stdout-errors-in-client.patch b/backport-check-for-stdout-errors-in-client.patch new file mode 100644 index 0000000000000000000000000000000000000000..60de60235acbb50e739716cfbded5603521bc5bf --- /dev/null +++ b/backport-check-for-stdout-errors-in-client.patch @@ -0,0 +1,38 @@ +From a73803770586c46cccc7dee7dffc2aa27e9b96c6 Mon Sep 17 00:00:00 2001 +From: Miroslav Lichvar +Date: Thu, 21 Jul 2022 8:17:03 PM GMT+0800 +Subject: [PATCH] client:check for stdout errors in client + +Conflict:NA +Reference:https://github.com/mlichvar/chrony/commit/a73803770586c46cccc7dee7dffc2aa27e9b96c6 + +--- + client.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/client.c b/client.c +index cc179c6..83d80cf 100644 +--- a/client.c ++++ b/client.c +@@ -3402,8 +3402,17 @@ process_line(char *line) + if (do_normal_submit) { + ret = request_reply(&tx_message, &rx_message, RPY_NULL, 1); + } ++ + fflush(stderr); +- fflush(stdout); ++ ++ if (fflush(stdout) != 0 || ferror(stdout) != 0) { ++ LOG(LOGS_ERR, "Could not write to stdout"); ++ ++ /* Return error for commands that print data */ ++ if (!do_normal_submit) ++ return 0; ++ } ++ + return ret; + } + +-- +2.23.0 + diff --git a/backport-fix-initial-poll-to-follow-non-LAN-minimum.patch b/backport-fix-initial-poll-to-follow-non-LAN-minimum.patch new file mode 100644 index 0000000000000000000000000000000000000000..5563b06a73ee1d190ae3341288e14f5180cac6d1 --- /dev/null +++ b/backport-fix-initial-poll-to-follow-non-LAN-minimum.patch @@ -0,0 +1,28 @@ +From 220e6d19074be5ba838954745233a20c732c8ded Mon Sep 17 00:00:00 2001 +From: Miroslav Lichvar +Date: Thu, 21 Jul 2022 8:17:10 PM GMT+0800 +Subject: [PATCH] ntp: fix initial poll to follow non LAN minimum + +Conflict:NA +Reference:https://github.com/mlichvar/chrony/commit/220e6d19074be5ba838954745233a20c732c8ded + +--- + ntp_core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ntp_core.c b/ntp_core.c +index 5470022..1ea5c84 100644 +--- a/ntp_core.c ++++ b/ntp_core.c +@@ -604,7 +604,7 @@ NCR_CreateInstance(NTP_Remote_Address *remote_addr, NTP_Source_Type type, + result->tx_timeout_id = 0; + result->tx_suspended = 1; + result->opmode = MD_OFFLINE; +- result->local_poll = result->minpoll; ++ result->local_poll = MAX(result->minpoll, MIN_NONLAN_POLL); + result->poll_score = 0.0; + zero_local_timestamp(&result->local_tx); + result->burst_good_samples_to_go = 0; +-- +2.23.0 + diff --git a/chrony.spec b/chrony.spec index 8b4b040febb637636efbc309b182318791d361d0..4ce2153c2a7942bd9cd3aa3dbfaa5b8452d8625f 100644 --- a/chrony.spec +++ b/chrony.spec @@ -2,7 +2,7 @@ Name: chrony Version: 4.1 -Release: 2 +Release: 3 Summary: An NTP client/server License: GPLv2 URL: https://chrony.tuxfamily.org @@ -12,6 +12,10 @@ Source1: chrony.dhclient Source6: https://github.com/mlichvar/clknetsim/archive/%{clknetsim_ver}/clknetsim-%{clknetsim_ver}.tar.gz Patch1: chrony-nm-dispatcher-dhcp.patch + +Patch6000: backport-check-for-stdout-errors-in-client.patch +Patch6001: backport-fix-initial-poll-to-follow-non-LAN-minimum.patch + BuildRequires: gcc gcc-c++ bison systemd libcap-devel libedit-devel nettle-devel pps-tools-devel libseccomp-devel Requires: shadow-utils systemd timedatex @@ -134,6 +138,13 @@ fi %{_mandir}/man[158]/%{name}*.[158]* %changelog +* Mon Mar 6 2023 chengyechun - 4.1-3 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:client:check for stdout errors + ntp:fix initial poll to follow non-LAN minimum + * Wed Dec 28 2022 chengyechun - 4.1-2 - Type:bugfix - ID:NA