From patchwork Fri Dec 2 03:58:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 9457769 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4BEF86074E for ; Fri, 2 Dec 2016 03:59:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4140B28489 for ; Fri, 2 Dec 2016 03:59:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3570828505; Fri, 2 Dec 2016 03:59:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD2F328489 for ; Fri, 2 Dec 2016 03:59:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752563AbcLBD7z (ORCPT ); Thu, 1 Dec 2016 22:59:55 -0500 Received: from mx2.suse.de ([195.135.220.15]:36544 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752480AbcLBD7y (ORCPT ); Thu, 1 Dec 2016 22:59:54 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4C7CFAAA3; Fri, 2 Dec 2016 03:59:53 +0000 (UTC) From: NeilBrown To: "J. Bruce Fields" , Steve Dickson Date: Fri, 02 Dec 2016 14:58:29 +1100 Subject: [PATCH 11/15] conffile: ignore setting of empty string Cc: linux-nfs@vger.kernel.org Message-ID: <148065110977.28046.4258233430833825030.stgit@noble> In-Reply-To: <148065078775.28046.5506130555300891075.stgit@noble> References: <148065078775.28046.5506130555300891075.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A value setting like foo = is now equivalent to not setting "foo" at all. This is likely to be least confusing. Signed-off-by: NeilBrown --- support/nfs/conffile.c | 2 ++ systemd/nfs.conf.man | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c index 947bf9bad1e7..eaff5f5c35ea 100644 --- a/support/nfs/conffile.c +++ b/support/nfs/conffile.c @@ -748,6 +748,8 @@ conf_set(int transaction, char *section, char *arg, { struct conf_trans *node; + if (!value || !*value) + return 0; node = conf_trans_node(transaction, CONF_SET); if (!node) return 1; diff --git a/systemd/nfs.conf.man b/systemd/nfs.conf.man index 8e2f034d0b9b..8cf55668b664 100644 --- a/systemd/nfs.conf.man +++ b/systemd/nfs.conf.man @@ -36,7 +36,8 @@ in the current section to Leading and trailing spaces and tab are ignored, as are spaces and tabs surrounding the equals sign. Single and double quotes surrounding the assigned value are also -removed. +removed. If the resulting string is empty, the whole assignment +is ignored. .PP Any line starting with .RB \*(lq # \*(rq