]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pager: lets check SYSTEMD_PAGERSECURE with secure_getenv()
authorLennart Poettering <lennart@poettering.net>
Thu, 15 Oct 2020 08:54:48 +0000 (10:54 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 15 Oct 2020 08:54:53 +0000 (10:54 +0200)
I can't think of any real vulnerability about this, but it still feels
better to check a variable with "secure" in its name with
secure_getenv() rather than plain getenv().

Paranoia FTW!

src/shared/pager.c

index 9a14d44d696bb07a045f16fba1d8c00f5c547c89..9af7009b3f3aa7823558496b64ebbe5be816eb11 100644 (file)
@@ -171,7 +171,7 @@ int pager_open(PagerFlags flags) {
                  * pager. If they didn't, use secure mode when under euid is changed. If $SYSTEMD_PAGERSECURE
                  * wasn't explicitly set, and we autodetect the need for secure mode, only use the pager we
                  * know to be good. */
-                int use_secure_mode = getenv_bool("SYSTEMD_PAGERSECURE");
+                int use_secure_mode = getenv_bool_secure("SYSTEMD_PAGERSECURE");
                 bool trust_pager = use_secure_mode >= 0;
                 if (use_secure_mode == -ENXIO) {
                         uid_t uid;