]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - elf/enbl-secure.c
test-container: Fix "unused code" warnings on HURD
[thirdparty/glibc.git] / elf / enbl-secure.c
index f668ee9a2a383a8616a5fd92e5812cba6604a36a..aa2a0bd87705d995ca776b6c0428a3d2d7e23ccc 100644 (file)
@@ -1,5 +1,5 @@
 /* Define and initialize the `__libc_enable_secure' flag.  Generic version.
-   Copyright (C) 1996-2020 Free Software Foundation, Inc.
+   Copyright (C) 1996-2022 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
 /* This file is used in the static libc.  For the shared library,
    dl-sysdep.c defines and initializes __libc_enable_secure.  */
 
-#include <unistd.h>
+/* Mark symbols hidden in static PIE for early self relocation to work.  */
+#if BUILD_PIE_DEFAULT
+# pragma GCC visibility push(hidden)
+#endif
+#include <startup.h>
 #include <libc-internal.h>
 
 /* If nonzero __libc_enable_secure is already set.  */
@@ -31,6 +35,6 @@ void
 __libc_init_secure (void)
 {
   if (__libc_enable_secure_decided == 0)
-    __libc_enable_secure = (__geteuid () != __getuid ()
-                           || __getegid () != __getgid ());
+    __libc_enable_secure = (startup_geteuid () != startup_getuid ()
+                           || startup_getegid () != startup_getgid ());
 }