diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-09-14 09:20:27 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-09-14 09:20:27 +0200 |
commit | 71e0acccfdc32de01e72ea22ece2fb9f0cbce48c (patch) | |
tree | ba132eb58b78c65f84859a08bb5b3d7694235587 /src/basic/env-util.c | |
parent | fe102d6ab15731a199a7ea9f38c4f68d8959f86c (diff) | |
download | systemd-71e0acccfdc32de01e72ea22ece2fb9f0cbce48c.tar.gz |
nss: use secure_getenv for behaviour-modifying booleans (#6817)
Follow up for fe102d6ab15731a199a7ea9f38c4f68d8959f86c.
Diffstat (limited to 'src/basic/env-util.c')
-rw-r--r-- | src/basic/env-util.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/basic/env-util.c b/src/basic/env-util.c index 56e7b6fd8c..d72940acb3 100644 --- a/src/basic/env-util.c +++ b/src/basic/env-util.c @@ -769,6 +769,16 @@ int getenv_bool(const char *p) { return parse_boolean(e); } +int getenv_bool_secure(const char *p) { + const char *e; + + e = secure_getenv(p); + if (!e) + return -ENXIO; + + return parse_boolean(e); +} + int serialize_environment(FILE *f, char **environment) { char **e; |