From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id UNpcMnf1+2OPdQEAbAwnHQ (envelope-from ) for ; Mon, 27 Feb 2023 01:12:39 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id yAsTMnf1+2NjggEAauVa8A (envelope-from ) for ; Mon, 27 Feb 2023 01:12:39 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7AA408BF0 for ; Mon, 27 Feb 2023 01:12:39 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1677456759; a=rsa-sha256; cv=none; b=Mf3V3dDvKKhhn5nIIbQqvR5tzo9L1K5XQNKIvzCsCOgrzuJyeQcb6sER2RQ9h5vFor7C5U mRvuIbvif23mFGr5J3nAQbukfi31j85RFCABTRkeHrxrXBzpZynsCUOVWH0cT3dIblohUO q9knzHw5zI7u87Yl4/qo4XwmIvmnRngI+2zy4i4GMKX2WHvNJEW4vC2vPPQiXPrco9Gfqt paxmT2Nq0wJuMbPybvapkGKr/+LqLsmz9wiOXGBuVbqhfc4TYp/udUMIizyEZH8bZN22kY BoeXdHkl/s3FJOeLjIZsGR6NxM6qLbGZ09IOOuaJKpgCD8wWx7d+yIDeaeajUw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1677456759; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=TP3XhIg8hAf/tr4NAMTMF+e97jRWxBcTWct9BZ8CBZs=; b=gOgXNvS4agMVkJInt1vn6rQy0hCuB4bE7TR8hWB4tLZHS6+WX5UUNl2P3/ORzs86wN1Qxs HORaOsSAbD01mg+hL0ywoh1TyJ+BuZ3MV/nf67luuM6zsYx+UsdSQ0NAuzcbikwvW4t2BC dNmtOg5jWBFdUGFCYTD5yFD66jASH0aYFa3g5LAEcp++Rcjcejlb1du41UT1uyc/hS2W7q TNyvhAvb6nI7DN3bDBayG8aRNpWmjzwceOyVYvaK8NZsucVh7sN/yXwv+5IbfV4gzKpevr aI9PVsSmTeN4YxxRpQYFiGKhGN+/JZ0Q7TqHGdGoeI+UrEJKgVedxlYOXOn38g== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWR7f-0000qE-TU; Sun, 26 Feb 2023 19:12:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pWR7c-0000nK-AG for guix-patches@gnu.org; Sun, 26 Feb 2023 19:12:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWR7b-0007Mk-Q8 for guix-patches@gnu.org; Sun, 26 Feb 2023 19:12:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pWR7b-0005Tr-MK for guix-patches@gnu.org; Sun, 26 Feb 2023 19:12:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61829] [PATCH 03/11] services: ntp-service-type: Remove deprecated server as strings support. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 27 Feb 2023 00:12:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61829 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61829@debbugs.gnu.org Cc: Bruno Victal Received: via spool by 61829-submit@debbugs.gnu.org id=B61829.167745671721010 (code B ref 61829); Mon, 27 Feb 2023 00:12:03 +0000 Received: (at 61829) by debbugs.gnu.org; 27 Feb 2023 00:11:57 +0000 Received: from localhost ([127.0.0.1]:45294 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWR7U-0005Si-NZ for submit@debbugs.gnu.org; Sun, 26 Feb 2023 19:11:57 -0500 Received: from smtpm7.myservices.hosting ([185.26.105.208]:47724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWR7Q-0005Re-0e for 61829@debbugs.gnu.org; Sun, 26 Feb 2023 19:11:54 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm7.myservices.hosting (Postfix) with ESMTP id 61FD120C76 for <61829@debbugs.gnu.org>; Mon, 27 Feb 2023 01:11:51 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 18F578009B; Mon, 27 Feb 2023 01:11:51 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id PxR3fy5uAd91; Mon, 27 Feb 2023 01:11:50 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-119-177.dsl.telepac.pt [85.242.119.177]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 1B55A8009A; Mon, 27 Feb 2023 01:11:50 +0100 (CET) From: Bruno Victal Date: Mon, 27 Feb 2023 00:11:36 +0000 Message-Id: <2046be031f35d2eb4e9ed278c06a2e832d565671.1677456515.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: X-Migadu-Queue-Id: 7AA408BF0 X-Spam-Score: -1.99 X-Migadu-Spam-Score: -1.99 X-Migadu-Scanner: scn0.migadu.com List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-TUID: u4Ru15AzFh3r * gnu/services/networking.scm ()[servers]: Rename accessor to ntp-configuration-servers. (ntp-configuration-servers): Remove helper procedure. (ntp-shepherd-service): Remove helper procedure usage. * tests/networking.scm: Remove obsolete test. --- gnu/services/networking.scm | 57 +++++++++++++------------------------ tests/networking.scm | 11 ------- 2 files changed, 20 insertions(+), 48 deletions(-) diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index dacf64c2d1..ef66393937 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm @@ -481,36 +481,19 @@ (define-record-type* ntp-configuration? (ntp ntp-configuration-ntp (default ntp)) - (servers %ntp-configuration-servers ;list of objects + (servers ntp-configuration-servers ;list of objects (default %ntp-servers)) (allow-large-adjustment? ntp-allow-large-adjustment? (default #t))) ;as recommended in the ntpd manual -(define (ntp-configuration-servers ntp-configuration) - ;; A wrapper to support the deprecated form of this field. - (let ((ntp-servers (%ntp-configuration-servers ntp-configuration))) - (match ntp-servers - (((? string?) (? string?) ...) - (format (current-error-port) "warning: Defining NTP servers as strings is \ -deprecated. Please use records instead.\n") - (map (lambda (addr) - (ntp-server - (type 'server) - (address addr) - (options '()))) ntp-servers)) - ((($ ) ($ ) ...) - ntp-servers)))) - (define (ntp-shepherd-service config) (match-record config (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") - " + ;; 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: # . restrict default kod nomodify notrap nopeer noquery limited @@ -524,21 +507,21 @@ (define (ntp-shepherd-service config) # 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") - '())) - #:log-file "/var/log/ntpd.log")) - (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") + '())) + #:log-file "/var/log/ntpd.log")) + (stop #~(make-kill-destructor)))))) (define %ntp-accounts (list (user-account diff --git a/tests/networking.scm b/tests/networking.scm index f2421370d2..fbf8db7a02 100644 --- a/tests/networking.scm +++ b/tests/networking.scm @@ -43,17 +43,6 @@ (define %ntp-server-sample "server some.ntp.server.org iburst version 3 maxpoll 16 prefer" (ntp-server->string %ntp-server-sample)) -(test-equal "ntp configuration servers deprecated form" - (ntp-configuration-servers - (ntp-configuration - (servers (list "example.pool.ntp.org")))) - (ntp-configuration-servers - (ntp-configuration - (servers (list (ntp-server - (type 'server) - (address "example.pool.ntp.org") - (options '()))))))) - ;;; ;;; OpenNTPD -- 2.39.1