[glibc] hurd: Assume non-suid during bootstrap

Samuel Thibault sthibaul@sourceware.org
Fri Aug 19 00:26:34 GMT 2022


https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f7b0fc5cc61301461e3c1a278240ce78701bb9a8

commit f7b0fc5cc61301461e3c1a278240ce78701bb9a8
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Fri Aug 19 02:16:54 2022 +0200

    hurd: Assume non-suid during bootstrap
    
    We do not have a hurd data block only when bootstrapping the system, in
    which case we don't have a notion of suid yet anyway.
    
    This is needed, otherwise init_standard_fds would check that standard
    file descriptors are allocated, which is meaningless during bootstrap.

Diff:
---
 sysdeps/mach/hurd/i386/init-first.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c
index 534a796e0d..f10d4a1bc2 100644
--- a/sysdeps/mach/hurd/i386/init-first.c
+++ b/sysdeps/mach/hurd/i386/init-first.c
@@ -95,8 +95,13 @@ init1 (int argc, char *arg0, ...)
   d = (void *) ++envp;
 
   if ((void *) d == argv[0])
-    /* No Hurd data block to process.  */
-    return;
+    {
+      /* No Hurd data block to process.  */
+#ifndef SHARED
+      __libc_enable_secure = 0;
+#endif
+      return;
+    }
 
 #ifndef SHARED
   __libc_enable_secure = d->flags & EXEC_SECURE;


More information about the Glibc-cvs mailing list