hurd: Assume non-suid during bootstrap
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Fri, 19 Aug 2022 00:16:54 +0000 (02:16 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Fri, 19 Aug 2022 00:26:21 +0000 (02:26 +0200)
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.

sysdeps/mach/hurd/i386/init-first.c

index 534a796e0d76f1fbe4632e3cad8ddd22bc0c5229..f10d4a1bc2b6c363a4f284b3bddeccdcac915bf8 100644 (file)
@@ -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;