diff options
| author | Karel Zak <kzak@redhat.com> | 2025-05-20 20:08:09 +0200 |
|---|---|---|
| committer | Karel Zak <kzak@redhat.com> | 2025-05-20 20:08:09 +0200 |
| commit | 78914c80540663e666841713b3a3ef7ae5396e05 (patch) | |
| tree | f41bd2bfb2f7792131d861d4ff2f1c8c308a62f4 /lib/env.c | |
| parent | f8d41ab00438a85cc955b9b2004f3034b8fa6029 (diff) | |
| download | util-linux-78914c80540663e666841713b3a3ef7ae5396e05.tar.gz | |
treewide: improve getauxval(AT_SECURE) usage
Let's enhance portability and readability slightly.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib/env.c')
| -rw-r--r-- | lib/env.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -16,7 +16,6 @@ #include <sys/syscall.h> #endif #include <unistd.h> -#include <sys/auxv.h> // for getauxval() #include <sys/types.h> #include "env.h" @@ -261,7 +260,7 @@ void sanitize_env(void) char *safe_getenv(const char *arg) { - if (getauxval(AT_SECURE)) + if (is_privileged_execution()) return NULL; #ifdef HAVE_PRCTL if (prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) == 0) |
