aboutsummaryrefslogtreecommitdiffstats
path: root/lib/env.c
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2025-05-20 20:08:09 +0200
committerKarel Zak <kzak@redhat.com>2025-05-20 20:08:09 +0200
commit78914c80540663e666841713b3a3ef7ae5396e05 (patch)
treef41bd2bfb2f7792131d861d4ff2f1c8c308a62f4 /lib/env.c
parentf8d41ab00438a85cc955b9b2004f3034b8fa6029 (diff)
downloadutil-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.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/env.c b/lib/env.c
index 3fc4f2e21e..dc65c5584a 100644
--- a/lib/env.c
+++ b/lib/env.c
@@ -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)