From patchwork Thu May 26 13:09:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Attila Lendvai X-Patchwork-Id: 39616 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3755A27BBEA; Thu, 26 May 2022 14:12:16 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id ABE7C27BBE9 for ; Thu, 26 May 2022 14:12:15 +0100 (BST) Received: from localhost ([::1]:38366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nuDHi-0006dH-Sj for patchwork@mira.cbaines.net; Thu, 26 May 2022 09:12:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nuDHX-0006az-Fa for guix-patches@gnu.org; Thu, 26 May 2022 09:12:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35267) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nuDHW-0005L2-OG for guix-patches@gnu.org; Thu, 26 May 2022 09:12:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nuDHW-0003sg-JX for guix-patches@gnu.org; Thu, 26 May 2022 09:12:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55659] [PATCH 1/2] services: ddclient: Fix extra-options serialization. Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 26 May 2022 13:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55659 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55659@debbugs.gnu.org Cc: Attila Lendvai X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165357069314880 (code B ref -1); Thu, 26 May 2022 13:12:02 +0000 Received: (at submit) by debbugs.gnu.org; 26 May 2022 13:11:33 +0000 Received: from localhost ([127.0.0.1]:57397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuDH3-0003rw-8F for submit@debbugs.gnu.org; Thu, 26 May 2022 09:11:33 -0400 Received: from lists.gnu.org ([209.51.188.17]:45346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nuDH1-0003rj-CK for submit@debbugs.gnu.org; Thu, 26 May 2022 09:11:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nuDGy-0006A9-13 for guix-patches@gnu.org; Thu, 26 May 2022 09:11:31 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:44631) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nuDGw-0005Hd-DF for guix-patches@gnu.org; Thu, 26 May 2022 09:11:27 -0400 Received: by mail-ed1-x531.google.com with SMTP id q15so1739341edb.11 for ; Thu, 26 May 2022 06:11:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PVK9k6o7iD7ezZV5hNYYBdRbQJxrqn9y1anWpOM6eKw=; b=h93PSr2DChdjzPFsJ6Q4xSTfhotflsx27MUttcMAsHPPCr0jK2azw7byx2LS8drhbg aEo/GLF76jvnDf27l7XTY321bKDN3APhEs9beMrQxFhwyH9pTJnS5L3muy6Wgl/Qt0o0 bWsuD3Q3iOelgYB5yPfhhC6W+zDBBsI2TlrcH28OuBGryXpe1mnjnpyF98E/OWwfv+6C q+8aO4/r2irsicpWPQ6vDdOMVzn7Ky5NqmS7X3BqFsiWBDj9SP4tcuut1xFVPEkTlYXn v2QWXthuaQJgaLB1NDCoaJBJPezgwkd9gXQAgQv16f1te8QaTRc8QKtO5tm6iMoV7aEg fxRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=PVK9k6o7iD7ezZV5hNYYBdRbQJxrqn9y1anWpOM6eKw=; b=MxMhwGulNMvnDjpWnvYLgqv5/xjHPKnFsdt6DL6gd1lZUKQWFHT4k/IkC6MSwrjoju 7LQhKl2hFhlyYku+wBSzjMtrC/xJlDxFlPA7Tgd3SwLzKTYkfdDJjXk6Lo7N8PBnKv7K CViW5+LVTlKnjDOlbwmAh2+o4X+sR0r1orqJdU7+572pR5cwi0Qt4preAxf7bWv+ki5s 3rotQ+WFLTxFyNarEVEedMTQ+1JwrNMlemQN/MYhCJvHfrSyFkvO1oUVqoLuUbXUhf8I 4GKRqHAHtPmiCWso/LVwNLGAVsMGPj+k/No31fcL+czjVOg2kxQyPmwuZpHXqEQOe8AE XRnQ== X-Gm-Message-State: AOAM533ImV3lSfqRhhI2Cfgs5T1Q575BXtSQui8/VmqxKjA5jVEupKsJ dwvzn1DSyv0QpQXd9KJ52V7rNtBmo3E= X-Google-Smtp-Source: ABdhPJwK/VzZ3YHpiAVSzY3J4PGWWHZVKqbkzZfxLeNXjwtYgxroxxUon8fzOQ2y98lqSX9nUQtZjA== X-Received: by 2002:a05:6402:401b:b0:42b:5bbf:4b88 with SMTP id d27-20020a056402401b00b0042b5bbf4b88mr23986643eda.238.1653570684853; Thu, 26 May 2022 06:11:24 -0700 (PDT) Received: from lelap.local (catv-89-132-245-188.catv.fixed.vodafone.hu. [89.132.245.188]) by smtp.gmail.com with ESMTPSA id q29-20020a50aa9d000000b0042aad7448besm790100edc.18.2022.05.26.06.11.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 May 2022 06:11:24 -0700 (PDT) From: Attila Lendvai Date: Thu, 26 May 2022 15:09:12 +0200 Message-Id: <20220526130912.29483-1-attila@lendvai.name> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=attila.lendvai@gmail.com; helo=mail-ed1-x531.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action 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: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Prior to this fix it has serialized "extra-options=..." into the ddclient.conf file. * gnu/services/dns.scm (serialize-field): Special case for extra-options. (serialize-extra-options): Deleted unused function. (ddclient-configuration): Change the type of the extra-options field to be a string, and emit it verbatime into the ddclient.conf file. Change docstring accordingly. --- please note that even though this does fix an issue, i have abandoned further work on ddclient. so, this is an improvement indeed, but i suspect that this does not fully fix ddclient. looks like the conf file format is different than what the current code emits. the next patch updates ddclient to an RC2 of the next version, which will be a major upgrade. gnu/services/dns.scm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm index 50753b7ab6..c2ede312e8 100644 --- a/gnu/services/dns.scm +++ b/gnu/services/dns.scm @@ -904,8 +904,11 @@ (define (uglify-field-name field-name) (string-delete #\? (symbol->string field-name))) (define (serialize-field field-name val) - (when (not (member field-name '(group secret-file user))) - (format #t "~a=~a\n" (uglify-field-name field-name) val))) + (cond + ((eq? field-name 'extra-options) + (display val)) + ((not (member field-name '(group secret-file user))) + (format #t "~a=~a\n" (uglify-field-name field-name) val)))) (define (serialize-boolean field-name val) (serialize-field field-name (if val "yes" "no"))) @@ -921,9 +924,6 @@ (define (serialize-string field-name val) (define (serialize-list field-name val) (if (null? val) "" (serialize-field field-name (string-join val)))) -(define (serialize-extra-options extra-options) - (string-join extra-options "\n" 'suffix)) - (define-configuration ddclient-configuration (ddclient (file-like ddclient) @@ -959,8 +959,8 @@ (define-configuration ddclient-configuration file contains credentials for use by ddclient. You are expected to create it manually.") (extra-options - (list '()) - "Extra options will be appended to @file{ddclient.conf} file.")) + (string "") + "Extra options will be appended verbatim to the @file{ddclient.conf} file.")) (define (ddclient-account config) "Return the user accounts and user groups for CONFIG."