aboutsummaryrefslogtreecommitdiffstats
path: root/lib/env.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/env.c')
-rw-r--r--lib/env.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/env.c b/lib/env.c
index 0874fe482b..3fc4f2e21e 100644
--- a/lib/env.c
+++ b/lib/env.c
@@ -16,6 +16,7 @@
#include <sys/syscall.h>
#endif
#include <unistd.h>
+#include <sys/auxv.h> // for getauxval()
#include <sys/types.h>
#include "env.h"
@@ -260,7 +261,7 @@ void sanitize_env(void)
char *safe_getenv(const char *arg)
{
- if ((getuid() != geteuid()) || (getgid() != getegid()))
+ if (getauxval(AT_SECURE))
return NULL;
#ifdef HAVE_PRCTL
if (prctl(PR_GET_DUMPABLE, 0, 0, 0, 0) == 0)