diff options
| author | NeilBrown <neilb@suse.com> | 2017-02-15 10:29:36 -0500 |
|---|---|---|
| committer | Steve Dickson <steved@redhat.com> | 2017-02-15 10:41:59 -0500 |
| commit | 2b4b895faff5239774510afaa9948fea54e6967a (patch) | |
| tree | 230afc38e1dba129280c0941448c3ae1da9175c9 | |
| parent | 907426b00bdcd69d9a56ac1870990e8ae8c6fe9f (diff) | |
| download | nfs-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.c | 2 |
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; |
