aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/generic/enbl-secure.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/generic/enbl-secure.c')
-rw-r--r--sysdeps/generic/enbl-secure.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sysdeps/generic/enbl-secure.c b/sysdeps/generic/enbl-secure.c
index c811712087..fac3b9c527 100644
--- a/sysdeps/generic/enbl-secure.c
+++ b/sysdeps/generic/enbl-secure.c
@@ -1,5 +1,5 @@
/* Define and initialize the `__libc_enable_secure' flag. Generic version.
- Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 2000, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,12 +23,15 @@
#include <unistd.h>
#include <libc-internal.h>
+/* If nonzero __libc_enable_secure is already set. */
+int __libc_enable_secure_decided;
/* Safest assumption, if somehow the initializer isn't run. */
int __libc_enable_secure = 1;
void
__libc_init_secure (void)
{
- __libc_enable_secure = (__geteuid () != __getuid ()
- || __getegid () != __getgid ());
+ if (__libc_enable_secure_decided == 0)
+ __libc_enable_secure = (__geteuid () != __getuid ()
+ || __getegid () != __getgid ());
}