bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Allow /hurd/init to be a symlink


From: Ludovic Courtès
Subject: [PATCH] Allow /hurd/init to be a symlink
Date: Mon, 07 Nov 2011 21:35:06 +0100
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux)

Hello!

The attached patch allows /hurd or /hurd/init to be a symlink to an
absolute path.

OK to apply?

Thanks,
Ludo’.

diff --git a/libdiskfs/boot-start.c b/libdiskfs/boot-start.c
index e73e4d3..30b54d3 100644
--- a/libdiskfs/boot-start.c
+++ b/libdiskfs/boot-start.c
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 1993,94,95,96,97,98,99,2000,01,02,10
+   Copyright (C) 1993,94,95,96,97,98,99,2000,01,02,10,11
        Free Software Foundation, Inc.
 
 This file is part of the GNU Hurd.
@@ -222,6 +222,7 @@ diskfs_start_bootstrap ()
       initname = exec_argv + 1;
     }
 
+ lookup_init:
   err = dir_lookup (root_pt, initname, O_READ, 0,
                    &retry, pathbuf, &startup_pt);
   if (err)
@@ -232,6 +233,13 @@ diskfs_start_bootstrap ()
       free (exec_argv);
       assert_perror (err);     /* XXX this won't reboot properly */
     }
+  else if (retry == FS_RETRY_MAGICAL && pathbuf[0] == '/')
+    {
+      /* INITNAME is a symlink with an absolute target, so try again.  */
+      initname = strdupa (pathbuf);
+      goto lookup_init;
+    }
+
   assert (retry == FS_RETRY_NORMAL);
   assert (pathbuf[0] == '\0');
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]