summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.com>2017-02-15 10:29:36 -0500
committerSteve Dickson <steved@redhat.com>2017-02-15 10:41:59 -0500
commit2b4b895faff5239774510afaa9948fea54e6967a (patch)
tree230afc38e1dba129280c0941448c3ae1da9175c9
parent907426b00bdcd69d9a56ac1870990e8ae8c6fe9f (diff)
downloadnfs-utils-2b4b895faff5239774510afaa9948fea54e6967a.tar.gz
conffile: ignore empty environment variables.
conf_set() already refuses to set an empty value, so if foo= appears in the config file, it will be ignored. This patch extends the policy to environment variables, so empty environment variables are treated as though they didn't exist. This means that a separate environment file (e.g. /etc/sysconfig/nfs) will be treated the same way whether it is: - included in the [environment] section of /etc/nfs.conf - sourced by the shell before running code - sourced by the systemd EnvironmentFile directive. Signed-off-by: NeilBrown <neilb@suse.com> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--support/nfs/conffile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c
index e717c1e..203efd2 100644
--- a/support/nfs/conffile.c
+++ b/support/nfs/conffile.c
@@ -533,7 +533,7 @@ retry:
* or from environment
*/
char *env = getenv(cb->value+1);
- if (env)
+ if (env && *env)
return env;
section = "environment";
tag = cb->value + 1;