conffile: ignore empty environment variables.
Subsystems (2)
PATCH 1/1 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.
--- support/nfs/conffile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
support/nfs/conffile.c +1 -1
@@ -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 ;
Signature · 1 line
2.11.0
Quoted 6 lines · NeilBrown
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.
Quoted 7 lines
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 <[email protected]>
Committed...
steved.
Quoted 17 lines
--- support/nfs/conffile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)support/nfs/conffile.c +1
-1@@ -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 ;