[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#38122] [PATCH 020/197] services: ntp: Fix a crash when using legacy
From: |
Hartmut Goebel |
Subject: |
[bug#38122] [PATCH 020/197] services: ntp: Fix a crash when using legacy configuration. |
Date: |
Fri, 8 Nov 2019 11:33:48 +0100 |
From: Maxim Cournoyer <address@hidden>
Fixes issue #37504 (see: https://bugs.gnu.org/37504).
The bug was caused by the fact that destructuring an <ntp-configuration>
record using match would bind the 'servers' field without using the
compatibility accessor.
* gnu/services/networking.scm (ntp-shepherd-service): Replace `match-lambda'
by distinct `lambda' and `match' calls, so that the 'servers' field can be
generated by applying the `ntp-configuration-servers' procedure to the
configuration object.
---
gnu/services/networking.scm | 45 +++++++++++++++++++------------------
1 file changed, 23 insertions(+), 22 deletions(-)
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 841fbd741e..a1c1aad9f6 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -394,15 +394,16 @@ deprecated. Please use <ntp-server> records instead.\n")
ntp-servers))))
(define ntp-shepherd-service
- (match-lambda
- (($ <ntp-configuration> ntp servers allow-large-adjustment?)
- (let ()
- ;; TODO: Add authentication support.
- (define config
- (string-append "driftfile /var/run/ntpd/ntp.drift\n"
- (string-join (map ntp-server->string servers)
- "\n")
- "
+ (lambda (config)
+ (match config
+ (($ <ntp-configuration> ntp servers allow-large-adjustment?)
+ (let ((servers (ntp-configuration-servers config)))
+ ;; TODO: Add authentication support.
+ (define config
+ (string-append "driftfile /var/run/ntpd/ntp.drift\n"
+ (string-join (map ntp-server->string servers)
+ "\n")
+ "
# Disable status queries as a workaround for CVE-2013-5211:
#
<http://support.ntp.org/bin/view/Main/SecurityNotice#DRDoS_Amplification_Attack_using>.
restrict default kod nomodify notrap nopeer noquery limited
@@ -416,20 +417,20 @@ restrict -6 ::1
# option by default, as documented in the 'ntp.conf' manual.
restrict source notrap nomodify noquery\n"))
- (define ntpd.conf
- (plain-file "ntpd.conf" config))
+ (define ntpd.conf
+ (plain-file "ntpd.conf" config))
- (list (shepherd-service
- (provision '(ntpd))
- (documentation "Run the Network Time Protocol (NTP) daemon.")
- (requirement '(user-processes networking))
- (start #~(make-forkexec-constructor
- (list (string-append #$ntp "/bin/ntpd") "-n"
- "-c" #$ntpd.conf "-u" "ntpd"
- #$@(if allow-large-adjustment?
- '("-g")
- '()))))
- (stop #~(make-kill-destructor))))))))
+ (list (shepherd-service
+ (provision '(ntpd))
+ (documentation "Run the Network Time Protocol (NTP) daemon.")
+ (requirement '(user-processes networking))
+ (start #~(make-forkexec-constructor
+ (list (string-append #$ntp "/bin/ntpd") "-n"
+ "-c" #$ntpd.conf "-u" "ntpd"
+ #$@(if allow-large-adjustment?
+ '("-g")
+ '()))))
+ (stop #~(make-kill-destructor)))))))))
(define %ntp-accounts
(list (user-account
--
2.21.0
- [bug#38122] [PATCH 010/197] services: ntp: Ensure no double quotes are output to config file., (continued)
- [bug#38122] [PATCH 010/197] services: ntp: Ensure no double quotes are output to config file., Hartmut Goebel, 2019/11/08
- [bug#38122] [PATCH 012/197] gnu: pingus: Adjust for GCC 7., Hartmut Goebel, 2019/11/08
- [bug#38122] [PATCH 011/197] gnu: pingus: Update source URI., Hartmut Goebel, 2019/11/08
- [bug#38122] [PATCH 008/197] gnu: Add python-keyutils., Hartmut Goebel, 2019/11/08
- [bug#38122] [PATCH 013/197] gnu: Remove python2-feather-format., Hartmut Goebel, 2019/11/08
- [bug#38122] [PATCH 009/197] gnu: Add udiskie., Hartmut Goebel, 2019/11/08
- [bug#38122] [PATCH 015/197] gnu: pocl: Update to 1.4., Hartmut Goebel, 2019/11/08
- [bug#38122] [PATCH 017/197] gnu: Chibi-Scheme: Update to 0.8., Hartmut Goebel, 2019/11/08
- [bug#38122] [PATCH 018/197] gnu: Chibi-Scheme: Do not use unstable tarball., Hartmut Goebel, 2019/11/08
- [bug#38122] [PATCH 021/197] gnu: musescore: Update to 3.3., Hartmut Goebel, 2019/11/08
- [bug#38122] [PATCH 020/197] services: ntp: Fix a crash when using legacy configuration.,
Hartmut Goebel <=
- [bug#38122] [PATCH 019/197] gnu: bitcoin-abc: Update to 0.20.4., Hartmut Goebel, 2019/11/08
- [bug#38122] [PATCH 014/197] gnu: u-boot: Remove redundant GCC input., Hartmut Goebel, 2019/11/08
- [bug#38122] [PATCH 016/197] gnu: icecat: Update to 68.2.0-guix0-preview3., Hartmut Goebel, 2019/11/08
- bug#38122: Faulty patchset, Hartmut Goebel, 2019/11/08