commit-hurd
[Top][All Lists]
Advanced

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

[SCM] Debian GNU Hurd packaging branch, master, updated. debian/20120520


From: Samuel Thibault
Subject: [SCM] Debian GNU Hurd packaging branch, master, updated. debian/20120520-1-18-g9d27a93
Date: Tue, 05 Jun 2012 09:26:06 +0000

The following commit has been merged in the master branch:
commit 9d27a93d76b23856818902033e5b2a5841b21eb2
Author: Samuel Thibault <address@hidden>
Date:   Tue Jun 5 11:25:19 2012 +0000

    Add support for passing filename through exec() call.

diff --git a/debian/changelog b/debian/changelog
index 7398c82..cf75629 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,8 @@ hurd (20120605-1) UNRELEASED; urgency=low
   * local/setup-translators: Remove /dev/shm directory if any, to be replaced
     with symlink to /run/shm.
   * patches/balloc.patch: Fix parentheses.
+  * patches/exec_filename_{exec,fs,use}.patch: Add support for passing
+    filename through exec() call.
 
  -- Samuel Thibault <address@hidden>  Tue, 22 May 2012 00:07:09 +0000
 
diff --git a/debian/patches/exec_filename_exec.patch 
b/debian/patches/exec_filename_exec.patch
new file mode 100644
index 0000000..3a4e035
--- /dev/null
+++ b/debian/patches/exec_filename_exec.patch
@@ -0,0 +1,338 @@
+From 011df9d35eb68132cdb14a0f55e2435375e2cfce Mon Sep 17 00:00:00 2001
+From: Emilio Pozuelo Monfort <address@hidden>
+Date: Wed, 26 May 2010 00:15:37 +0200
+Subject: [PATCH 1/3] Add a new exec_exec_file_name RPC
+
+* hurd/exec.defs (exec_exec_file_name): New RPC.
+(exec_exec): Label as deprecated.
+* doc/hurd.texi: Updated.
+* exec/exec.c (S_exec_exec_file_name): New function.
+(S_exec_exec): Label as deprecated.
+(do_exec): Add argument.
+* exec/hashexec.c (check_hashbang): Add argument.
+Don't guess the file name if file_name_exec is set.
+* exec/priv.h (check_hashbang): Add argument.
+---
+ doc/hurd.texi   |    8 ++++----
+ exec/exec.c     |   50 +++++++++++++++++++++++++++++++++++++++++++++-----
+ exec/hashexec.c |   18 ++++++++++++------
+ exec/priv.h     |    4 +++-
+ hurd/exec.defs  |   19 +++++++++++++++++--
+ 5 files changed, 81 insertions(+), 18 deletions(-)
+
+Index: hurd-debian/doc/hurd.texi
+===================================================================
+--- hurd-debian.orig/doc/hurd.texi     2012-06-03 20:17:54.000000000 +0000
++++ hurd-debian/doc/hurd.texi  2012-06-05 04:32:07.000000000 +0000
+@@ -102,7 +102,7 @@
+ documentation was last updated for version @value{VERSION} of the Hurd.
+ 
+ Copyright @copyright{} 1994, 1996, 1998, 1999, 2000, 2001, 2002, 2003,
+-2004, 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
++2004, 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ 
+ @quotation
+ Permission is granted to make and distribute verbatim copies of
+@@ -2770,14 +2770,14 @@
+ authentication handle that was not previously present (as opposed to
+ merely reordering them), then the @code{EXEC_SECURE} and
+ @code{EXEC_NEWTASK} flags should both be added in the call to
address@hidden
address@hidden
+ 
+ The server then needs to open a new port onto the executed file which
+ will not share any file pointers with the port the user passed in,
+ opened with @code{O_READ}.  Finally, all the information (mutated
+ appropriately for setuid/setgid) should be sent to the execserver with
address@hidden  Whatever error code @code{exec_exec} returns should
+-returned to the caller of @code{file_exec}.
address@hidden  Whatever error code @code{exec_exec_file_name}
++returns should be returned to the caller of @code{file_exec}.
+ 
+ @node File Locking
+ @subsection File Locking
+Index: hurd-debian/exec/exec.c
+===================================================================
+--- hurd-debian.orig/exec/exec.c       2012-06-03 17:08:36.000000000 +0000
++++ hurd-debian/exec/exec.c    2012-06-05 04:19:51.000000000 +0000
+@@ -1,6 +1,6 @@
+ /* GNU Hurd standard exec server.
+-   Copyright (C) 1992,93,94,95,96,98,99,2000,01,02,04
+-      Free Software Foundation, Inc.
++   Copyright (C) 1992 ,1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
++   2002, 2004, 2010 Free Software Foundation, Inc.
+    Written by Roland McGrath.
+ 
+    Can exec ELF format directly.
+@@ -1357,6 +1357,7 @@
+ do_exec (file_t file,
+        task_t oldtask,
+        int flags,
++       char *filename,
+        char *argv, mach_msg_type_number_t argvlen, boolean_t argv_copy,
+        char *envp, mach_msg_type_number_t envplen, boolean_t envp_copy,
+        mach_port_t *dtable, mach_msg_type_number_t dtablesize,
+@@ -1452,7 +1453,7 @@
+     {
+       /* Check for a #! executable file.  */
+       check_hashbang (&e,
+-                    file, oldtask, flags,
++                    file, oldtask, flags, filename,
+                     argv, argvlen, argv_copy,
+                     envp, envplen, envp_copy,
+                     dtable, dtablesize, dtable_copy,
+@@ -2055,6 +2056,7 @@
+   return e.error;
+ }
+ 
++/* Deprecated.  */
+ kern_return_t
+ S_exec_exec (struct trivfs_protid *protid,
+            file_t file,
+@@ -2071,6 +2073,44 @@
+            mach_port_t *deallocnames, mach_msg_type_number_t ndeallocnames,
+            mach_port_t *destroynames, mach_msg_type_number_t ndestroynames)
+ {
++  return S_exec_exec_file_name (protid,
++                              file,
++                              oldtask,
++                              flags,
++                              "",
++                              argv, argvlen, argv_copy,
++                              envp, envplen, envp_copy,
++                              dtable, dtablesize,
++                              dtable_copy,
++                              portarray, nports,
++                              portarray_copy,
++                              intarray, nints,
++                              intarray_copy,
++                              deallocnames, ndeallocnames,
++                              destroynames, ndestroynames);
++}
++
++kern_return_t
++S_exec_exec_file_name (struct trivfs_protid *protid,
++                     file_t file,
++                     task_t oldtask,
++                     int flags,
++                     char *filename,
++                     char *argv, mach_msg_type_number_t argvlen,
++                     boolean_t argv_copy,
++                     char *envp, mach_msg_type_number_t envplen,
++                     boolean_t envp_copy,
++                     mach_port_t *dtable, mach_msg_type_number_t dtablesize,
++                     boolean_t dtable_copy,
++                     mach_port_t *portarray, mach_msg_type_number_t nports,
++                     boolean_t portarray_copy,
++                     int *intarray, mach_msg_type_number_t nints,
++                     boolean_t intarray_copy,
++                     mach_port_t *deallocnames,
++                     mach_msg_type_number_t ndeallocnames,
++                     mach_port_t *destroynames,
++                     mach_msg_type_number_t ndestroynames)
++{
+   if (! protid)
+     return EOPNOTSUPP;
+ 
+@@ -2111,7 +2151,7 @@
+                                        trivfs_protid_portclasses[0]);
+                 if (protid)
+                   {
+-                    err = do_exec (file, oldtask, 0,
++                    err = do_exec (file, oldtask, 0, filename,
+                                    argv, argvlen, argv_copy,
+                                    envp, envplen, envp_copy,
+                                    dtable, dtablesize, dtable_copy,
+@@ -2158,7 +2198,7 @@
+   /* There were no user-specified exec servers,
+      or none of them could be found.  */
+ 
+-  return do_exec (file, oldtask, flags,
++  return do_exec (file, oldtask, flags, filename,
+                 argv, argvlen, argv_copy,
+                 envp, envplen, envp_copy,
+                 dtable, dtablesize, dtable_copy,
+Index: hurd-debian/exec/hashexec.c
+===================================================================
+--- hurd-debian.orig/exec/hashexec.c   2012-06-03 17:08:36.000000000 +0000
++++ hurd-debian/exec/hashexec.c        2012-06-05 04:32:38.000000000 +0000
+@@ -1,5 +1,6 @@
+ /* GNU Hurd standard exec server, #! script execution support.
+-   Copyright (C) 1995,96,97,98,99,2000,02 Free Software Foundation, Inc.
++   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2010
++   Free Software Foundation, Inc.
+    Written by Roland McGrath.
+ 
+ This file is part of the GNU Hurd.
+@@ -35,6 +36,7 @@
+               file_t file,
+               task_t oldtask,
+               int flags,
++              char *file_name_exec,
+               char *argv, u_int argvlen, boolean_t argv_copy,
+               char *envp, u_int envplen, boolean_t envp_copy,
+               mach_port_t *dtable, u_int dtablesize, boolean_t dtable_copy,
+@@ -225,10 +227,12 @@
+           file_name = NULL;
+         else if (! (flags & EXEC_SECURE))
+           {
+-            /* Try to figure out the file's name.  We guess that if ARGV[0]
+-               contains a slash, it might be the name of the file; and that
+-               if it contains no slash, looking for files named by ARGV[0] in
+-               the `PATH' environment variable might find it.  */
++            /* Try to figure out the file's name.  If FILE_NAME_EXEC
++               is not NULL, then it's the file's name.  Otherwise we
++               guess that if ARGV[0] contains a slash, it might be
++               the name of the file; and that if it contains no slash,
++               looking for files named by ARGV[0] in the `PATH'
++               environment variable might find it.  */
+ 
+             error_t error;
+             char *name;
+@@ -278,7 +282,9 @@
+             else
+               name = argv;
+ 
+-            if (strchr (name, '/') != NULL)
++            if (file_name_exec && file_name_exec[0] != '\0')
++              error = lookup (name = file_name_exec, 0, &name_file);
++            else if (strchr (name, '/') != NULL)
+               error = lookup (name, 0, &name_file);
+             else if ((error = hurd_catch_signal
+                       (sigmask (SIGBUS) | sigmask (SIGSEGV),
+Index: hurd-debian/exec/priv.h
+===================================================================
+--- hurd-debian.orig/exec/priv.h       2012-06-03 17:08:36.000000000 +0000
++++ hurd-debian/exec/priv.h    2012-06-05 03:36:44.000000000 +0000
+@@ -1,5 +1,6 @@
+ /* GNU Hurd standard exec server, private declarations.
+-   Copyright (C) 1992,93,94,95,96,99,2000,02, 04 Free Software Foundation, 
Inc.
++   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2002, 2004,
++   2010 Free Software Foundation, Inc.
+    Written by Roland McGrath.
+ 
+ This file is part of the GNU Hurd.
+@@ -36,6 +37,7 @@
+ #include <link.h>             /* This gives us the ElfW macro.  */
+ #include <fcntl.h>
+ #include "exec_S.h"
++#include "exec_experimental_S.h"
+ 
+ 
+ #ifndef exec_priv_h
+@@ -171,6 +173,7 @@
+                    file_t file,
+                    task_t oldtask,
+                    int flags,
++                   char *filename,
+                    char *argv, u_int argvlen, boolean_t argv_copy,
+                    char *envp, u_int envplen, boolean_t envp_copy,
+                    mach_port_t *dtable, u_int dtablesize,
+Index: hurd-debian/hurd/exec.defs
+===================================================================
+--- hurd-debian.orig/hurd/exec.defs    2012-06-03 17:08:36.000000000 +0000
++++ hurd-debian/hurd/exec.defs 2012-06-03 20:17:55.000000000 +0000
+@@ -1,5 +1,6 @@
+ /* Interface definitions for the exec servers.
+-   Copyright (C) 1991,92,93,94,95,2001 Free Software Foundation, Inc.
++   Copyright (C) 1991, 1992, 1993, 1994, 1995, 2001, 2010
++   Free Software Foundation, Inc.
+ 
+ This file is part of the GNU Hurd.
+ 
+@@ -29,6 +30,7 @@
+ 
+ INTR_INTERFACE
+ 
++/* Deprecated: use exec_exec_file_name instead.  */
+ routine exec_exec (
+       execserver: file_t;
+       file: mach_port_send_t;
+Index: hurd-debian/hurd/exec_experimental.defs
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ hurd-debian/hurd/exec_experimental.defs    2012-06-03 20:17:55.000000000 
+0000
+@@ -0,0 +1,46 @@
++/* Interface definitions for the exec servers.
++   Copyright (C) 1991, 1992, 1993, 1994, 1995, 2001, 2010, 2012
++   Free Software Foundation, Inc.
++
++This file is part of the GNU Hurd.
++
++The GNU Hurd is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2, or (at your option)
++any later version.
++
++The GNU Hurd is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with the GNU Hurd; see the file COPYING.  If not, write to
++the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
++
++/* Written by Michael I. Bushnell and Roland McGrath.  */
++
++subsystem exec_experimental 434242;
++
++#include <hurd/hurd_types.defs>
++
++#ifdef EXEC_IMPORTS
++EXEC_IMPORTS
++#endif
++
++INTR_INTERFACE
++
++routine exec_exec_file_name (
++      execserver: file_t;
++      file: mach_port_send_t;
++      oldtask: task_t;
++      flags: int;
++      filename: string_t;
++      argv: data_t SCP;
++      envp: data_t SCP;
++      dtable: portarray_t SCP;
++      portarray: portarray_t SCP;
++      intarray: intarray_t SCP;
++      deallocnames: mach_port_name_array_t;
++      destroynames: mach_port_name_array_t);
++
+Index: hurd-debian/exec/Makefile
+===================================================================
+--- hurd-debian.orig/exec/Makefile     2012-06-03 17:08:36.000000000 +0000
++++ hurd-debian/exec/Makefile  2012-06-05 03:39:06.000000000 +0000
+@@ -23,7 +23,7 @@
+ SRCS = exec.c main.c hashexec.c hostarch.c \
+        $(gzip-sources) $(bzip2-sources)
+ OBJS = main.o hostarch.o exec.o hashexec.o \
+-       execServer.o exec_startupServer.o \
++       execServer.o exec_startupServer.o exec_experimentalServer.o \
+        $(gzip-objects) $(bzip2-objects)
+ gzip-sources = unzip.c util.c inflate.c
+ gzip-objects = $(gzip-sources:%.c=%.o)
+@@ -36,6 +36,7 @@
+ HURDLIBS = trivfs fshelp iohelp threads ports ihash shouldbeinlibc
+ 
+ exec-MIGSFLAGS = -imacros $(srcdir)/execmutations.h
++exec_experimental-MIGSFLAGS = -imacros $(srcdir)/execmutations.h
+ 
+ include ../Makeconf
+ 
+Index: hurd-debian/exec/main.c
+===================================================================
+--- hurd-debian.orig/exec/main.c       2012-06-03 17:08:36.000000000 +0000
++++ hurd-debian/exec/main.c    2012-06-05 01:28:09.000000000 +0000
+@@ -58,9 +58,11 @@
+ exec_demuxer (mach_msg_header_t *inp, mach_msg_header_t *outp)
+ {
+   extern int exec_server (mach_msg_header_t *inp, mach_msg_header_t *outp);
++  extern int exec_experimental_server (mach_msg_header_t *inp, 
mach_msg_header_t *outp);
+   extern int exec_startup_server (mach_msg_header_t *, mach_msg_header_t *);
+   return (exec_startup_server (inp, outp) ||
+         exec_server (inp, outp) ||
++        exec_experimental_server (inp, outp) ||
+         trivfs_demuxer (inp, outp));
+ }
+ 
diff --git a/debian/patches/exec_filename_fs.patch 
b/debian/patches/exec_filename_fs.patch
new file mode 100644
index 0000000..276a8ae
--- /dev/null
+++ b/debian/patches/exec_filename_fs.patch
@@ -0,0 +1,1035 @@
+From ba528e4a9db131112aa09edfdbb3449b55618578 Mon Sep 17 00:00:00 2001
+From: Emilio Pozuelo Monfort <address@hidden>
+Date: Wed, 26 May 2010 01:27:40 +0200
+Subject: [PATCH 2/3] Add a file_exec_file_name RPC
+
+* hurd/fs.defs (file_exec): Deprecate in favor of...
+(file_exec_file_name): ...this new RPC.
+Change all implementations and forward old implementations to
+the new version.  Change all callers but fallback to old version.
+Change comments and documentation.
+---
+ TODO                              |    2 +-
+ doc/hurd.texi                     |   16 ++++----
+ exec/hashexec.c                   |   32 ++++++++++----
+ hurd/fs.defs                      |   28 +++++++++++--
+ hurd/hurd_types.h                 |    9 ++--
+ init/init.c                       |   81 ++++++++++++++++++++++++++----------
+ libdiskfs/boot-start.c            |    2 +-
+ libdiskfs/file-exec.c             |   75 ++++++++++++++++++++++++++++------
+ libfshelp/start-translator-long.c |   21 +++++++---
+ libnetfs/file-exec.c              |   67 ++++++++++++++++++++++++++----
+ libtrivfs/file-exec.c             |   27 ++++++++++++-
+ trans/fakeroot.c                  |   59 ++++++++++++++++++++++++---
+ utils/login.c                     |   23 +++++++---
+ 13 files changed, 350 insertions(+), 92 deletions(-)
+
+Index: hurd-debian/TODO
+===================================================================
+--- hurd-debian.orig/TODO      2012-06-05 05:01:41.000000000 +0000
++++ hurd-debian/TODO   2012-06-05 05:02:02.000000000 +0000
+@@ -136,7 +136,7 @@
+ 
+ ** libtrivfs
+ *** Allow for read/write/exec to be passed down.
+-*** Implement file_exec when appropriate. !!
++*** Implement file_exec_file_name when appropriate. !!
+ *** Provide for the visible owner, etc., to be held in command-line args
+     instead of the underlying node, when it's important. !!
+ 
+Index: hurd-debian/doc/hurd.texi
+===================================================================
+--- hurd-debian.orig/doc/hurd.texi     2012-06-05 05:02:02.000000000 +0000
++++ hurd-debian/doc/hurd.texi  2012-06-05 05:02:02.000000000 +0000
+@@ -2741,10 +2741,10 @@
+ @node Program Execution
+ @subsection Program Execution
+ 
address@hidden file_exec
address@hidden file_exec_file_name
+ Execution of programs on the Hurd is done through fileservers with the
address@hidden RPC.  The fileserver is expected to verify that the
+-user is allowed to execute the file, make whatever modifications to the
address@hidden RPC.  The fileserver is expected to verify that
++the user is allowed to execute the file, make whatever modifications to the
+ ports are necessary for setuid execution, and then invoke the standard
+ execserver found on @file{/servers/exec}.
+ 
+@@ -2756,13 +2756,13 @@
+ be returned.  In addition, at least one of the execute bits must be on.  A
+ failure of this check should result in @code{EACCES}---not
+ @code{ENOEXEC}.  It is not proper for the fileserver ever to respond to
+-the @code{file_exec} RPC with @code{ENOEXEC}.
++the @code{file_exec_file_name} RPC with @code{ENOEXEC}.
+ 
+ If either the setuid or setgid bits are set, the server needs to
+ construct a new authentication handle with the additional new ID's.
+-Then all the ports passed to @code{file_exec} need to be reauthenticated
+-with the new handle.  If the fileserver is unable to make the new
+-authentication handle (for example, because it is not running as root)
++Then all the ports passed to @code{file_exec_file_name} need to be
++reauthenticated with the new handle.  If the fileserver is unable to make the
++new authentication handle (for example, because it is not running as root)
+ it is not acceptable to return an error; in such a case the server
+ should simply silently fail to implement the setuid/setgid semantics.
+ 
+@@ -2777,7 +2777,7 @@
+ opened with @code{O_READ}.  Finally, all the information (mutated
+ appropriately for setuid/setgid) should be sent to the execserver with
+ @code{exec_exec_file_name}.  Whatever error code @code{exec_exec_file_name}
+-returns should be returned to the caller of @code{file_exec}.
++returns should be returned to the caller of @code{file_exec_file_name}.
+ 
+ @node File Locking
+ @subsection File Locking
+Index: hurd-debian/exec/hashexec.c
+===================================================================
+--- hurd-debian.orig/exec/hashexec.c   2012-06-05 05:02:02.000000000 +0000
++++ hurd-debian/exec/hashexec.c        2012-06-05 05:06:23.000000000 +0000
+@@ -24,6 +24,9 @@
+ #include <unistd.h>
+ #include <envz.h>
+ #include <sys/param.h>
++#ifdef HAVE_FILE_EXEC_FILE_NAME
++#include <hurd/fs_experimental.h>
++#endif
+ 
+ /* This is called to check E for a #! interpreter specification.  E has
+    already been prepared (successfully) and checked (unsuccessfully).  If
+@@ -421,16 +424,32 @@
+     /* We cannot open the interpreter file to execute it.  Lose!  */
+     return;
+ 
++#ifdef HAVE_FILE_EXEC_FILE_NAME
+   /* Execute the interpreter program.  */
+-  e->error = file_exec (interp_file,
+-                      oldtask, flags,
+-                      new_argv, new_argvlen, envp, envplen,
+-                      new_dtable ?: dtable, MACH_MSG_TYPE_COPY_SEND,
+-                      new_dtable ? new_dtablesize : dtablesize,
+-                      portarray, MACH_MSG_TYPE_COPY_SEND, nports,
+-                      intarray, nints,
+-                      deallocnames, ndeallocnames,
+-                      destroynames, ndestroynames);
++  e->error = file_exec_file_name (interp_file,
++                                oldtask, flags, interp,
++                                new_argv, new_argvlen, envp, envplen,
++                                new_dtable ?: dtable,
++                                MACH_MSG_TYPE_COPY_SEND,
++                                new_dtable ? new_dtablesize : dtablesize,
++                                portarray, MACH_MSG_TYPE_COPY_SEND, nports,
++                                intarray, nints,
++                                deallocnames, ndeallocnames,
++                                destroynames, ndestroynames);
++  /* For backwards compatibility.  Just drop it when we kill file_exec.  */
++  if (e->error == MIG_BAD_ID)
++#endif
++    e->error = file_exec (interp_file,
++                        oldtask, flags,
++                        new_argv, new_argvlen, envp, envplen,
++                        new_dtable ?: dtable, MACH_MSG_TYPE_COPY_SEND,
++                        new_dtable ? new_dtablesize : dtablesize,
++                        portarray, MACH_MSG_TYPE_COPY_SEND, nports,
++                        intarray, nints,
++                        deallocnames, ndeallocnames,
++                        destroynames, ndestroynames);
++
++
+   mach_port_deallocate (mach_task_self (), interp_file);
+ 
+   if (! e->error)
+Index: hurd-debian/hurd/fs.defs
+===================================================================
+--- hurd-debian.orig/hurd/fs.defs      2012-06-05 05:01:41.000000000 +0000
++++ hurd-debian/hurd/fs.defs   2012-06-05 05:02:02.000000000 +0000
+@@ -1,5 +1,6 @@
+ /* Definitions for the filesystem interface.
+-   Copyright (C) 1994,95,96,97,98,99,2002 Free Software Foundation, Inc.
++   Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2002, 2010
++   Free Software Foundation, Inc.
+ 
+ This file is part of the GNU Hurd.
+ 
+@@ -35,7 +36,8 @@
+ /* Overlay a task with a file.  Necessary initialization, including
+    authentication changes associated with set[ug]id execution must be
+    handled by the filesystem.  Filesystems normally implement this by
+-   using exec_newtask or exec_loadtask as appropriate.  */
++   using exec_newtask or exec_loadtask as appropriate.
++   Deprecated: use file_exec_file_name instead.  */
+ routine file_exec (
+       exec_file: file_t;
+       RPT
+@@ -129,8 +131,8 @@
+    (regardless of the current open modes for this port).  ALLOWED is a
+    bitwise OR of O_READ, O_WRITE, and O_EXEC.  This is not necessarily the
+    same as what an open or exec would allow; O_EXEC is set for root even if
+-   no executable bits are on (in which case file_exec should fail) and
+-   O_WRITE is set a directory can be modified, even though it can't be
++   no executable bits are on (in which case file_exec_file_name should fail)
++   and O_WRITE is set a directory can be modified, even though it can't be
+    written directly.  */
+ routine file_check_access (
+       file: file_t;
+Index: hurd-debian/hurd/hurd_types.h
+===================================================================
+--- hurd-debian.orig/hurd/hurd_types.h 2012-06-05 05:01:41.000000000 +0000
++++ hurd-debian/hurd/hurd_types.h      2012-06-05 05:02:02.000000000 +0000
+@@ -1,5 +1,6 @@
+ /* C declarations for Hurd server interfaces
+-   Copyright (C) 1993,94,95,96,98,99,2001,02 Free Software Foundation, Inc.
++   Copyright (C) 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002,
++   2010 Free Software Foundation, Inc.
+ 
+ This file is part of the GNU Hurd.
+ 
+@@ -76,7 +77,7 @@
+ /* Many such parameters and flags are also defined in various libc
+    headers. */
+ 
+-/* Bits for flags in fs.defs:file_exec and exec.defs:exec_* calls: */
++/* Bits for flags in fs.defs:file_exec_file_name and exec.defs:exec_* calls: 
*/
+ #define EXEC_NEWTASK  0x00000001 /* Create new task; kill old one.  */
+ #define EXEC_SECURE   0x00000002 /* Use secure values of portarray, etc. */
+ #define EXEC_DEFAULTS 0x00000004 /* Use defaults for unspecified ports.  */
+@@ -342,7 +343,7 @@
+ #define FSTYPE_MEMFS   0x00000019 /* In-core filesystem */
+ #define FSTYPE_ISO9660 0x0000001a /* ISO9660 */
+ 
+-/* Standard port assignments for file_exec and exec_* */
++/* Standard port assignments for file_exec_file_name and exec_* */
+ enum
+   {
+     INIT_PORT_CWDIR,
+@@ -356,7 +357,7 @@
+     INIT_PORT_MAX
+   };
+ 
+-/* Standard ints for file_exec and exec_* */
++/* Standard ints for file_exec_file_name and exec_* */
+ enum
+   {
+     INIT_UMASK,
+Index: hurd-debian/init/init.c
+===================================================================
+--- hurd-debian.orig/init/init.c       2012-06-05 05:02:02.000000000 +0000
++++ hurd-debian/init/init.c    2012-06-05 05:06:35.000000000 +0000
+@@ -1,7 +1,7 @@
+ /* Start and maintain hurd core servers and system run state
+ 
+    Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+-     2005, 2008 Free Software Foundation, Inc.
++     2005, 2008, 2010 Free Software Foundation, Inc.
+    This file is part of the GNU Hurd.
+ 
+    The GNU Hurd is free software; you can redistribute it and/or modify
+@@ -24,6 +24,9 @@
+    one file. */
+ #include <hurd.h>
+ #include <hurd/fs.h>
++#ifdef HAVE_FILE_EXEC_FILE_NAME
++#include <hurd/fs_experimental.h>
++#endif
+ #include <hurd/fsys.h>
+ #include <device/device.h>
+ #include <stdio.h>
+@@ -375,13 +378,28 @@
+             printf ("Pausing for %s\n", prog);
+             getchar ();
+           }
+-        err = file_exec (file, *task, 0,
+-                         (char *)prog, strlen (prog) + 1, /* Args.  */
+-                         startup_envz, startup_envz_len,
+-                         default_dtable, MACH_MSG_TYPE_COPY_SEND, 3,
+-                         ports, MACH_MSG_TYPE_COPY_SEND, INIT_PORT_MAX,
+-                         default_ints, INIT_INT_MAX,
+-                         NULL, 0, NULL, 0);
++#ifdef HAVE_FILE_EXEC_FILE_NAME
++        err = file_exec_file_name (file, *task, 0, (char *)prog,
++                                   (char *)prog,
++                                   strlen (prog) + 1, /* Args.  */
++                                   startup_envz, startup_envz_len,
++                                   default_dtable,
++                                   MACH_MSG_TYPE_COPY_SEND, 3,
++                                   ports, MACH_MSG_TYPE_COPY_SEND,
++                                   INIT_PORT_MAX,
++                                   default_ints, INIT_INT_MAX,
++                                   NULL, 0, NULL, 0);
++        /* For backwards compatibility.  Just drop it when we kill
++           file_exec.  */
++        if (err == MIG_BAD_ID)
++#endif
++          err = file_exec (file, *task, 0,
++                           (char *)prog, strlen (prog) + 1, /* Args.  */
++                           startup_envz, startup_envz_len,
++                           default_dtable, MACH_MSG_TYPE_COPY_SEND, 3,
++                           ports, MACH_MSG_TYPE_COPY_SEND, INIT_PORT_MAX,
++                           default_ints, INIT_INT_MAX,
++                           NULL, 0, NULL, 0);
+         if (!err)
+           break;
+ 
+@@ -468,14 +486,27 @@
+     ++progname;
+   else
+     progname = filename;
+-  err = file_exec (file, task, 0,
+-                 args, arglen,
+-                 startup_envz, startup_envz_len,
+-                 default_dtable, MACH_MSG_TYPE_COPY_SEND, 3,
+-                 default_ports, MACH_MSG_TYPE_COPY_SEND,
+-                 INIT_PORT_MAX,
+-                 default_ints, INIT_INT_MAX,
+-                 NULL, 0, NULL, 0);
++#ifdef HAVE_FILE_EXEC_FILE_NAME
++  err = file_exec_file_name (file, task, 0, filename,
++                           args, arglen,
++                           startup_envz, startup_envz_len,
++                           default_dtable, MACH_MSG_TYPE_COPY_SEND, 3,
++                           default_ports, MACH_MSG_TYPE_COPY_SEND,
++                           INIT_PORT_MAX,
++                           default_ints, INIT_INT_MAX,
++                           NULL, 0, NULL, 0);
++  /* For backwards compatibility.  Just drop it when we kill file_exec.  */
++  if (err == MIG_BAD_ID)
++#endif
++    err = file_exec (file, task, 0,
++                   args, arglen,
++                   startup_envz, startup_envz_len,
++                   default_dtable, MACH_MSG_TYPE_COPY_SEND, 3,
++                   default_ports, MACH_MSG_TYPE_COPY_SEND,
++                   INIT_PORT_MAX,
++                   default_ints, INIT_INT_MAX,
++                   NULL, 0, NULL, 0);
++
+   mach_port_deallocate (mach_task_self (), default_ports[INIT_PORT_PROC]);
+   mach_port_deallocate (mach_task_self (), task);
+   if (ctty != MACH_PORT_NULL)
+@@ -1059,13 +1090,26 @@
+       getchar ();
+     }
+ 
+-  err = file_exec (file, child_task, 0,
+-                 args, arglen,
+-                 startup_envz, startup_envz_len,
+-                 NULL, MACH_MSG_TYPE_COPY_SEND, 0, /* No fds.  */
+-                 default_ports, MACH_MSG_TYPE_COPY_SEND, INIT_PORT_MAX,
+-                 default_ints, INIT_INT_MAX,
+-                 NULL, 0, NULL, 0);
++#ifdef HAVE_FILE_EXEC_FILE_NAME
++  err = file_exec_file_name (file, child_task, 0, args,
++                           args, arglen,
++                           startup_envz, startup_envz_len,
++                           NULL, MACH_MSG_TYPE_COPY_SEND, 0, /* No fds.  */
++                           default_ports, MACH_MSG_TYPE_COPY_SEND,
++                           INIT_PORT_MAX,
++                           default_ints, INIT_INT_MAX,
++                           NULL, 0, NULL, 0);
++  /* For backwards compatibility.  Just drop it when we kill file_exec.  */
++  if (err == MIG_BAD_ID)
++#endif
++    err = file_exec (file, child_task, 0,
++                   args, arglen,
++                   startup_envz, startup_envz_len,
++                   NULL, MACH_MSG_TYPE_COPY_SEND, 0, /* No fds.  */
++                   default_ports, MACH_MSG_TYPE_COPY_SEND, INIT_PORT_MAX,
++                   default_ints, INIT_INT_MAX,
++                   NULL, 0, NULL, 0);
++
+   mach_port_deallocate (mach_task_self (), default_ports[INIT_PORT_PROC]);
+   mach_port_deallocate (mach_task_self (), file);
+   free (args);
+Index: hurd-debian/libdiskfs/boot-start.c
+===================================================================
+--- hurd-debian.orig/libdiskfs/boot-start.c    2012-06-05 05:02:02.000000000 
+0000
++++ hurd-debian/libdiskfs/boot-start.c 2012-06-05 05:02:02.000000000 +0000
+@@ -207,7 +207,7 @@
+       diskfs_exec_ctl = MACH_PORT_NULL;       /* Not used after this.  */
+     }
+ 
+-  /* Cache the exec server port for file_exec to use.  */
++  /* Cache the exec server port for file_exec_file_name to use.  */
+   _hurd_port_set (&_diskfs_exec_portcell, diskfs_exec);
+ 
+   if (_diskfs_boot_command)
+Index: hurd-debian/libdiskfs/file-exec.c
+===================================================================
+--- hurd-debian.orig/libdiskfs/file-exec.c     2012-06-05 05:01:41.000000000 
+0000
++++ hurd-debian/libdiskfs/file-exec.c  2012-06-05 05:07:14.000000000 +0000
+@@ -1,5 +1,6 @@
+-/* File execution (file_exec RPC) for diskfs servers, using exec server.
+-   Copyright (C) 1993,94,95,96,97,98,2000,02 Free Software Foundation, Inc.
++/* File execution (file_exec_file_name RPC) for diskfs servers, using exec 
server.
++   Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002,
++   2010 Free Software Foundation, Inc.
+ 
+ This file is part of the GNU Hurd.
+ 
+@@ -21,10 +22,14 @@
+ 
+ #include "priv.h"
+ #include "fs_S.h"
++#include "fs_experimental_S.h"
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <hurd/exec.h>
+ #include <hurd/paths.h>
++#ifdef HAVE_EXEC_EXEC_FILE_NAME
++#include <hurd/exec_experimental.h>
++#endif
+ #include <string.h>
+ #include <idvec.h>
+ 
+@@ -47,6 +52,39 @@
+                   mach_port_t *destroynames,
+                   size_t destroynameslen)
+ {
++  return diskfs_S_file_exec_file_name (cred,
++                                     task,
++                                     flags,
++                                     "",
++                                     argv, argvlen,
++                                     envp, envplen,
++                                     fds, fdslen,
++                                     portarray, portarraylen,
++                                     intarray, intarraylen,
++                                     deallocnames, deallocnameslen,
++                                     destroynames, destroynameslen);
++}
++
++kern_return_t
++diskfs_S_file_exec_file_name (struct protid *cred,
++                            task_t task,
++                            int flags,
++                            char *filename,
++                            char *argv,
++                            size_t argvlen,
++                            char *envp,
++                            size_t envplen,
++                            mach_port_t *fds,
++                            size_t fdslen,
++                            mach_port_t *portarray,
++                            size_t portarraylen,
++                            int *intarray,
++                            size_t intarraylen,
++                            mach_port_t *deallocnames,
++                            size_t deallocnameslen,
++                            mach_port_t *destroynames,
++                            size_t destroynameslen)
++{
+   struct node *np;
+   uid_t uid;
+   gid_t gid;
+@@ -136,9 +174,9 @@
+ 
+   if (! err)
+     /* Make a new peropen for the exec server to access the file, since any
+-       seeking the exec server might want to do should not affect the
+-       original peropen on which file_exec was called.  (The new protid for
+-       this peropen clones the caller's iouser to preserve the caller's
++       seeking the exec server might want to do should not affect the original
++       peropen on which file_exec_file_name was called.  (The new protid
++       for this peropen clones the caller's iouser to preserve the caller's
+        authentication credentials.)  The new peropen's openmodes must have
+        O_READ even if the caller had only O_EXEC privilege, so the exec
+        server can read the executable file.  We also include O_EXEC so that
+@@ -159,14 +197,31 @@
+       do
+       {
+         right = ports_get_send_right (newpi);
+-        err = exec_exec (execserver,
+-                         right, MACH_MSG_TYPE_COPY_SEND,
+-                         task, flags, argv, argvlen, envp, envplen,
+-                         fds, MACH_MSG_TYPE_COPY_SEND, fdslen,
+-                         portarray, MACH_MSG_TYPE_COPY_SEND, portarraylen,
+-                         intarray, intarraylen,
+-                         deallocnames, deallocnameslen,
+-                         destroynames, destroynameslen);
++#ifdef HAVE_EXEC_EXEC_FILE_NAME
++        err = exec_exec_file_name (execserver,
++                                   right, MACH_MSG_TYPE_COPY_SEND,
++                                   task, flags, filename,
++                                   argv, argvlen, envp, envplen,
++                                   fds, MACH_MSG_TYPE_COPY_SEND, fdslen,
++                                   portarray, MACH_MSG_TYPE_COPY_SEND,
++                                   portarraylen,
++                                   intarray, intarraylen,
++                                   deallocnames, deallocnameslen,
++                                   destroynames, destroynameslen);
++        /* For backwards compatibility.  Just drop it when we kill
++           exec_exec.  */
++        if (err == MIG_BAD_ID)
++#endif
++          err = exec_exec (execserver,
++                           right, MACH_MSG_TYPE_COPY_SEND,
++                           task, flags, argv, argvlen, envp, envplen,
++                           fds, MACH_MSG_TYPE_COPY_SEND, fdslen,
++                           portarray, MACH_MSG_TYPE_COPY_SEND, portarraylen,
++                           intarray, intarraylen,
++                           deallocnames, deallocnameslen,
++                           destroynames, destroynameslen);
++
++
+         mach_port_deallocate (mach_task_self (), right);
+         if (err == MACH_SEND_INVALID_DEST)
+           {
+Index: hurd-debian/libfshelp/start-translator-long.c
+===================================================================
+--- hurd-debian.orig/libfshelp/start-translator-long.c 2012-06-05 
05:01:41.000000000 +0000
++++ hurd-debian/libfshelp/start-translator-long.c      2012-06-05 
05:07:36.000000000 +0000
+@@ -1,5 +1,6 @@
+ /*
+-   Copyright (C) 1995,96,99,2000,02, 04 Free Software Foundation, Inc.
++   Copyright (C) 1995, 1996, 1999, 2000, 2002, 2004, 2010
++   Free Software Foundation, Inc.
+    Written by Miles Bader and Michael I. Bushnell.
+ 
+    This file is part of the GNU Hurd.
+@@ -27,6 +28,9 @@
+ #include <string.h>
+ #include <assert.h>
+ #include "fshelp.h"
++#ifdef HAVE_FILE_EXEC_FILE_NAME
++#include <hurd/fs_experimental.h>
++#endif
+ 
+ 
+ /* The data passed in the various messages we're interested in.  */
+@@ -264,12 +268,22 @@
+   saveport = ports[INIT_PORT_BOOTSTRAP];
+   ports[INIT_PORT_BOOTSTRAP] = bootstrap;
+ 
++#ifdef HAVE_FILE_EXEC_FILE_NAME
+   /* Try and exec the translator in TASK...  */
+-  err = file_exec (executable, task, EXEC_DEFAULTS,
+-                 argz, argz_len, 0, 0,
+-                 fds, fds_type, fds_len,
+-                 ports, ports_type, ports_len,
+-                 ints, ints_len, 0, 0, 0, 0);
++  err = file_exec_file_name (executable, task, EXEC_DEFAULTS, name,
++                           argz, argz_len, 0, 0,
++                           fds, fds_type, fds_len,
++                           ports, ports_type, ports_len,
++                           ints, ints_len, 0, 0, 0, 0);
++  /* For backwards compatibility.  Just drop it when we kill file_exec.  */
++  if (err == MIG_BAD_ID)
++#endif
++    err = file_exec (executable, task, EXEC_DEFAULTS,
++                   argz, argz_len, 0, 0,
++                   fds, fds_type, fds_len,
++                   ports, ports_type, ports_len,
++                   ints, ints_len, 0, 0, 0, 0);
++
+   ports_moved = 1;
+ 
+   if (ports_type == MACH_MSG_TYPE_COPY_SEND)
+Index: hurd-debian/libnetfs/file-exec.c
+===================================================================
+--- hurd-debian.orig/libnetfs/file-exec.c      2012-06-05 05:01:41.000000000 
+0000
++++ hurd-debian/libnetfs/file-exec.c   2012-06-05 05:07:49.000000000 +0000
+@@ -1,5 +1,6 @@
+ /*
+-   Copyright (C) 1996,97,2000,01,02 Free Software Foundation, Inc.
++   Copyright (C) 1996, 1997, 2000, 2001, 2002, 2010
++   Free Software Foundation, Inc.
+    Written by Michael I. Bushnell, p/BSG.
+ 
+    This file is part of the GNU Hurd.
+@@ -23,10 +24,14 @@
+ #include "netfs.h"
+ #include "execserver.h"
+ #include "fs_S.h"
++#include "fs_experimental_S.h"
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <hurd/exec.h>
+ #include <hurd/paths.h>
++#ifdef HAVE_EXEC_EXEC_FILE_NAME
++#include <hurd/exec_experimental.h>
++#endif
+ #include <string.h>
+ #include <idvec.h>
+ 
+@@ -49,6 +54,39 @@
+                  mach_port_t *destroynames,
+                  size_t destroynameslen)
+ {
++  return netfs_S_file_exec_file_name (cred,
++                                    task,
++                                    flags,
++                                    "",
++                                    argv, argvlen,
++                                    envp, envplen,
++                                    fds, fdslen,
++                                    portarray, portarraylen,
++                                    intarray, intarraylen,
++                                    deallocnames, deallocnameslen,
++                                    destroynames, destroynameslen);
++}
++
++kern_return_t
++netfs_S_file_exec_file_name (struct protid *cred,
++                           task_t task,
++                           int flags,
++                           char *filename,
++                           char *argv,
++                           size_t argvlen,
++                           char *envp,
++                           size_t envplen,
++                           mach_port_t *fds,
++                           size_t fdslen,
++                           mach_port_t *portarray,
++                           size_t portarraylen,
++                           int *intarray,
++                           size_t intarraylen,
++                           mach_port_t *deallocnames,
++                           size_t deallocnameslen,
++                           mach_port_t *destroynames,
++                           size_t destroynameslen)
++{
+   struct node *np;
+   error_t err;
+   uid_t uid;
+@@ -133,14 +171,31 @@
+         if (newpi)
+           {
+             right = ports_get_send_right (newpi);
+-            err = exec_exec (_netfs_exec,
+-                             right, MACH_MSG_TYPE_COPY_SEND,
+-                             task, flags, argv, argvlen, envp, envplen,
+-                             fds, MACH_MSG_TYPE_COPY_SEND, fdslen,
+-                             portarray, MACH_MSG_TYPE_COPY_SEND, portarraylen,
+-                             intarray, intarraylen,
+-                             deallocnames, deallocnameslen,
+-                             destroynames, destroynameslen);
++#ifdef HAVE_EXEC_EXEC_FILE_NAME
++            err = exec_exec_file_name (_netfs_exec,
++                                       right, MACH_MSG_TYPE_COPY_SEND,
++                                       task, flags, filename,
++                                       argv, argvlen, envp, envplen,
++                                       fds, MACH_MSG_TYPE_COPY_SEND, fdslen,
++                                       portarray, MACH_MSG_TYPE_COPY_SEND,
++                                       portarraylen,
++                                       intarray, intarraylen,
++                                       deallocnames, deallocnameslen,
++                                       destroynames, destroynameslen);
++            /* For backwards compatibility.  Just drop it when we kill
++               exec_exec.  */
++            if (err == MIG_BAD_ID)
++#endif
++              err = exec_exec (_netfs_exec,
++                               right, MACH_MSG_TYPE_COPY_SEND,
++                               task, flags, argv, argvlen, envp, envplen,
++                               fds, MACH_MSG_TYPE_COPY_SEND, fdslen,
++                               portarray, MACH_MSG_TYPE_COPY_SEND,
++                               portarraylen,
++                               intarray, intarraylen,
++                               deallocnames, deallocnameslen,
++                               destroynames, destroynameslen);
++
+             mach_port_deallocate (mach_task_self (), right);
+             ports_port_deref (newpi);
+           }
+Index: hurd-debian/libtrivfs/file-exec.c
+===================================================================
+--- hurd-debian.orig/libtrivfs/file-exec.c     2012-06-05 05:01:41.000000000 
+0000
++++ hurd-debian/libtrivfs/file-exec.c  2012-06-05 05:02:02.000000000 +0000
+@@ -1,5 +1,5 @@
+ /*
+-   Copyright (C) 1994,2002 Free Software Foundation, Inc.
++   Copyright (C) 1994, 2002, 2010 Free Software Foundation, Inc.
+ 
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License as
+@@ -40,3 +40,28 @@
+ {
+   return EOPNOTSUPP;
+ }
++
++kern_return_t
++trivfs_S_file_exec_file_name (trivfs_protid_t exec_file,
++                            mach_port_t reply,
++                            mach_msg_type_name_t replyPoly,
++                            mach_port_t exec_task,
++                            int flags,
++                            string_t filename,
++                            data_t argv,
++                            mach_msg_type_number_t argvCnt,
++                            data_t envp,
++                            mach_msg_type_number_t envpCnt,
++                            portarray_t fdarray,
++                            mach_msg_type_number_t fdarrayCnt,
++                            portarray_t portarray,
++                            mach_msg_type_number_t portarrayCnt,
++                            intarray_t intarray,
++                            mach_msg_type_number_t intarrayCnt,
++                            mach_port_array_t deallocnames,
++                            mach_msg_type_number_t deallocnamesCnt,
++                            mach_port_array_t destroynames,
++                            mach_msg_type_number_t destroynamesCnt)
++{
++  return EOPNOTSUPP;
++}
+Index: hurd-debian/trans/fakeroot.c
+===================================================================
+--- hurd-debian.orig/trans/fakeroot.c  2012-06-05 05:01:41.000000000 +0000
++++ hurd-debian/trans/fakeroot.c       2012-06-05 05:08:00.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* fakeroot -- a translator for faking actions that aren't really permitted
+-   Copyright (C) 2002, 2003, 2008 Free Software Foundation, Inc.
++   Copyright (C) 2002, 2003, 2008, 2010 Free Software Foundation, Inc.
+ 
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License as
+@@ -28,6 +28,9 @@
+ #include <cthreads.h>
+ #include <hurd/ihash.h>
+ #include <hurd/paths.h>
++#ifdef HAVE_FILE_EXEC_FILE_NAME
++#include <hurd/fs_experimental.h>
++#endif
+ 
+ #include <version.h>
+ 
+@@ -705,6 +708,39 @@
+                    mach_port_t *destroynames,
+                    size_t destroynameslen)
+ {
++  return netfs_S_file_exec_file_name (user,
++                                    task,
++                                    flags,
++                                    "",
++                                    argv, argvlen,
++                                    envp, envplen,
++                                    fds, fdslen,
++                                    portarray, portarraylen,
++                                    intarray, intarraylen,
++                                    deallocnames, deallocnameslen,
++                                    destroynames, destroynameslen);
++}
++
++kern_return_t
++netfs_S_file_exec_file_name (struct protid *user,
++                           task_t task,
++                           int flags,
++                           char *filename,
++                           char *argv,
++                           size_t argvlen,
++                           char *envp,
++                           size_t envplen,
++                           mach_port_t *fds,
++                           size_t fdslen,
++                           mach_port_t *portarray,
++                           size_t portarraylen,
++                           int *intarray,
++                           size_t intarraylen,
++                           mach_port_t *deallocnames,
++                           size_t deallocnameslen,
++                           mach_port_t *destroynames,
++                           size_t destroynameslen)
++{
+   error_t err;
+   file_t file;
+ 
+@@ -721,13 +757,29 @@
+ 
+   if (!err)
+     {
++#ifdef HAVE_FILE_EXEC_FILE_NAME
+       /* We cannot use MACH_MSG_TYPE_MOVE_SEND because we might need to
+        retry an interrupted call that would have consumed the rights.  */
+-      err = file_exec (user->po->np->nn->file, task, flags, argv, argvlen,
+-                     envp, envplen, fds, MACH_MSG_TYPE_COPY_SEND, fdslen,
+-                     portarray, MACH_MSG_TYPE_COPY_SEND, portarraylen,
+-                     intarray, intarraylen, deallocnames, deallocnameslen,
+-                     destroynames, destroynameslen);
++      err = file_exec_file_name (user->po->np->nn->file, task, flags,
++                               filename,
++                               argv, argvlen,
++                               envp, envplen,
++                               fds, MACH_MSG_TYPE_COPY_SEND, fdslen,
++                               portarray, MACH_MSG_TYPE_COPY_SEND,
++                               portarraylen,
++                               intarray, intarraylen,
++                               deallocnames, deallocnameslen,
++                               destroynames, destroynameslen);
++      /* For backwards compatibility.  Just drop it when we kill
++       file_exec.  */
++      if (err == MIG_BAD_ID)
++#endif
++      err = file_exec (user->po->np->nn->file, task, flags, argv, argvlen,
++                       envp, envplen, fds, MACH_MSG_TYPE_COPY_SEND, fdslen,
++                       portarray, MACH_MSG_TYPE_COPY_SEND, portarraylen,
++                       intarray, intarraylen, deallocnames, deallocnameslen,
++                       destroynames, destroynameslen);
++
+       mach_port_deallocate (mach_task_self (), file);
+     }
+ 
+@@ -835,12 +887,14 @@
+              mach_msg_header_t *outp)
+ {
+   int netfs_fs_server (mach_msg_header_t *, mach_msg_header_t *);
++  int netfs_fs_experimental_server (mach_msg_header_t *, mach_msg_header_t *);
+   int netfs_io_server (mach_msg_header_t *, mach_msg_header_t *);
+   int netfs_fsys_server (mach_msg_header_t *, mach_msg_header_t *);
+   int netfs_ifsock_server (mach_msg_header_t *, mach_msg_header_t *);
+ 
+   if (netfs_io_server (inp, outp)
+       || netfs_fs_server (inp, outp)
++      || netfs_fs_experimental_server (inp, outp)
+       || ports_notify_server (inp, outp)
+       || netfs_fsys_server (inp, outp)
+       /* XXX we should intercept interrupt_operation and do
+Index: hurd-debian/utils/login.c
+===================================================================
+--- hurd-debian.orig/utils/login.c     2012-06-05 05:01:41.000000000 +0000
++++ hurd-debian/utils/login.c  2012-06-05 05:08:09.000000000 +0000
+@@ -1,6 +1,7 @@
+ /* Hurdish login
+ 
+-   Copyright (C) 1995,96,97,98,99,2002 Free Software Foundation, Inc.
++   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2002, 2010
++   Free Software Foundation, Inc.
+ 
+    Written by Miles Bader <address@hidden>
+ 
+@@ -46,6 +47,9 @@
+ #include <error.h>
+ #include <timefmt.h>
+ #include <hurd/lookup.h>
++#ifdef HAVE_FILE_EXEC_FILE_NAME
++#include <hurd/fs_experimental.h>
++#endif
+ #include <ugids.h>
+ 
+ const char *argp_program_version = STANDARD_HURD_VERSION (login);
+@@ -882,12 +886,22 @@
+       }
+     }
+ 
+-  err = file_exec (exec, mach_task_self (), EXEC_DEFAULTS,
+-                 sh_args, sh_args_len, env, env_len,
+-                 fds, MACH_MSG_TYPE_COPY_SEND, 3,
+-                 ports, MACH_MSG_TYPE_COPY_SEND, INIT_PORT_MAX,
+-                 ints, INIT_INT_MAX,
+-                 0, 0, 0, 0);
++#ifdef HAVE_FILE_EXEC_FILE_NAME
++  err = file_exec_file_name (exec, mach_task_self (), EXEC_DEFAULTS, shell,
++                           sh_args, sh_args_len, env, env_len,
++                           fds, MACH_MSG_TYPE_COPY_SEND, 3,
++                           ports, MACH_MSG_TYPE_COPY_SEND, INIT_PORT_MAX,
++                           ints, INIT_INT_MAX,
++                           0, 0, 0, 0);
++  /* Fallback in case the file server hasn't been restarted.  */
++  if (err == MIG_BAD_ID)
++#endif
++    err = file_exec (exec, mach_task_self (), EXEC_DEFAULTS,
++                   sh_args, sh_args_len, env, env_len,
++                   fds, MACH_MSG_TYPE_COPY_SEND, 3,
++                   ports, MACH_MSG_TYPE_COPY_SEND, INIT_PORT_MAX,
++                   ints, INIT_INT_MAX,
++                   0, 0, 0, 0);
+   if (err)
+     error(5, err, "%s", shell);
+ 
+Index: hurd-debian/hurd/fs_experimental.defs
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ hurd-debian/hurd/fs_experimental.defs      2012-06-05 05:02:02.000000000 
+0000
+@@ -0,0 +1,51 @@
++/* Definitions for the filesystem interface.
++   Copyright (C) 1994,95,96,97,98,99,2002 Free Software Foundation, Inc.
++
++This file is part of the GNU Hurd.
++
++The GNU Hurd is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2, or (at your option)
++any later version.
++
++The GNU Hurd is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with the GNU Hurd; see the file COPYING.  If not, write to
++the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
++
++
++/* All these objects also implement the generic IO facilities. */
++
++subsystem fs_experimental 444242;
++
++#include <hurd/hurd_types.defs>
++
++#ifdef FILE_IMPORTS
++FILE_IMPORTS
++#endif
++
++/* Operations supported on all files */
++
++INTR_INTERFACE
++
++/* Overlay a task with a file.  Necessary initialization, including
++   authentication changes associated with set[ug]id execution must be
++   handled by the filesystem.  Filesystems normally implement this by
++   using exec_newtask or exec_loadtask as appropriate.  */
++routine file_exec_file_name (
++      exec_file: file_t;
++      RPT
++      exec_task: task_t;
++      flags: int;
++      filename: string_t;
++      argv: data_t SCP;
++      envp: data_t SCP;
++      fdarray: portarray_t SCP;
++      portarray: portarray_t SCP;
++      intarray: intarray_t SCP;
++      deallocnames: mach_port_name_array_t SCP;
++      destroynames: mach_port_name_array_t SCP);
+Index: hurd-debian/libdiskfs/Makefile
+===================================================================
+--- hurd-debian.orig/libdiskfs/Makefile        2012-06-05 05:01:41.000000000 
+0000
++++ hurd-debian/libdiskfs/Makefile     2012-06-05 05:02:02.000000000 +0000
+@@ -55,7 +55,7 @@
+ SRCS = $(OTHERSRCS) $(FSSRCS) $(IOSRCS) $(FSYSSRCS) $(IFSOCKSRCS)
+ installhdrs = diskfs.h diskfs-pager.h
+ 
+-MIGSTUBS = fsServer.o ioServer.o fsysServer.o exec_startupServer.o \
++MIGSTUBS = fsServer.o fs_experimentalServer.o ioServer.o fsysServer.o 
exec_startupServer.o \
+       fsys_replyUser.o fs_notifyUser.o ifsockServer.o \
+       startup_notifyServer.o
+ OBJS = $(sort $(SRCS:.c=.o) $(MIGSTUBS))
+@@ -64,6 +64,7 @@
+ 
+ fsys-MIGSFLAGS = -imacros $(srcdir)/fsmutations.h -DREPLY_PORTS
+ fs-MIGSFLAGS = -imacros $(srcdir)/fsmutations.h
++fs_experimental-MIGSFLAGS = -imacros $(srcdir)/fsmutations.h
+ io-MIGSFLAGS = -imacros $(srcdir)/fsmutations.h
+ ifsock-MIGSFLAGS = -imacros $(srcdir)/fsmutations.h
+ MIGCOMSFLAGS = -prefix diskfs_
+Index: hurd-debian/libdiskfs/demuxer.c
+===================================================================
+--- hurd-debian.orig/libdiskfs/demuxer.c       2012-06-05 05:01:41.000000000 
+0000
++++ hurd-debian/libdiskfs/demuxer.c    2012-06-05 05:02:02.000000000 +0000
+@@ -22,6 +22,7 @@
+               mach_msg_header_t *outp)
+ {
+   int diskfs_fs_server (mach_msg_header_t *, mach_msg_header_t *);
++  int diskfs_fs_experimental_server (mach_msg_header_t *, mach_msg_header_t 
*);
+   int diskfs_io_server (mach_msg_header_t *, mach_msg_header_t *);
+   int diskfs_fsys_server (mach_msg_header_t *, mach_msg_header_t *);
+   int diskfs_exec_startup_server (mach_msg_header_t *, mach_msg_header_t *);
+@@ -31,6 +32,7 @@
+   
+   return (diskfs_io_server (inp, outp)
+         || diskfs_fs_server (inp, outp)
++        || diskfs_fs_experimental_server (inp, outp)
+         || ports_notify_server (inp, outp)
+         || diskfs_fsys_server (inp, outp)
+         || diskfs_exec_startup_server (inp, outp)
+Index: hurd-debian/libnetfs/Makefile
+===================================================================
+--- hurd-debian.orig/libnetfs/Makefile 2012-06-05 05:01:41.000000000 +0000
++++ hurd-debian/libnetfs/Makefile      2012-06-05 05:02:02.000000000 +0000
+@@ -57,12 +57,13 @@
+ 
+ installhdrs=netfs.h
+ 
+-MIGSTUBS= ioServer.o fsServer.o fsysServer.o fsys_replyUser.o ifsockServer.o
++MIGSTUBS= ioServer.o fsServer.o fs_experimentalServer.o fsysServer.o 
fsys_replyUser.o ifsockServer.o
+ 
+ OBJS=$(sort $(SRCS:.c=.o) $(MIGSTUBS))
+ 
+ fsys-MIGSFLAGS = -imacros $(srcdir)/mutations.h -DREPLY_PORTS
+ fs-MIGSFLAGS = -imacros $(srcdir)/mutations.h
++fs_experimental-MIGSFLAGS = -imacros $(srcdir)/mutations.h
+ io-MIGSFLAGS = -imacros $(srcdir)/mutations.h
+ ifsock-MIGSFLAGS = -imacros $(srcdir)/mutations.h
+ MIGCOMSFLAGS = -prefix netfs_
+Index: hurd-debian/libnetfs/demuxer.c
+===================================================================
+--- hurd-debian.orig/libnetfs/demuxer.c        2012-06-05 05:01:41.000000000 
+0000
++++ hurd-debian/libnetfs/demuxer.c     2012-06-05 05:02:02.000000000 +0000
+@@ -25,12 +25,14 @@
+              mach_msg_header_t *outp)
+ {
+   int netfs_fs_server (mach_msg_header_t *, mach_msg_header_t *);
++  int netfs_fs_experimental_server (mach_msg_header_t *, mach_msg_header_t *);
+   int netfs_io_server (mach_msg_header_t *, mach_msg_header_t *);
+   int netfs_fsys_server (mach_msg_header_t *, mach_msg_header_t *);
+   int netfs_ifsock_server (mach_msg_header_t *, mach_msg_header_t *);
+ 
+   return (netfs_io_server (inp, outp)
+           || netfs_fs_server (inp, outp)
++          || netfs_fs_experimental_server (inp, outp)
+           || ports_notify_server (inp, outp)
+           || netfs_fsys_server (inp, outp)
+           || ports_interrupt_server (inp, outp)
+Index: hurd-debian/libtrivfs/Makefile
+===================================================================
+--- hurd-debian.orig/libtrivfs/Makefile        2012-06-05 05:01:41.000000000 
+0000
++++ hurd-debian/libtrivfs/Makefile     2012-06-05 05:02:02.000000000 +0000
+@@ -43,7 +43,7 @@
+ 
+ SRCS=$(FSSRCS) $(IOSRCS) $(FSYSSRCS) $(OTHERSRCS)
+ 
+-MIGSTUBS=fsServer.o ioServer.o fsysServer.o fsys_replyUser.o
++MIGSTUBS=fsServer.o fs_experimentalServer.o ioServer.o fsysServer.o 
fsys_replyUser.o
+ 
+ libname = libtrivfs
+ HURDLIBS = fshelp iohelp ports shouldbeinlibc
+@@ -53,7 +53,7 @@
+ installhdrs := trivfs.h
+ mig-sheader-prefix = trivfs_
+ ifndef no_deps
+-installhdrs += $(patsubst %,trivfs_%_S.h,fs io fsys)
++installhdrs += $(patsubst %,trivfs_%_S.h,fs fs_experimental io fsys)
+ endif
+ 
+ include ../Makeconf
+Index: hurd-debian/libtrivfs/demuxer.c
+===================================================================
+--- hurd-debian.orig/libtrivfs/demuxer.c       2012-06-05 05:01:41.000000000 
+0000
++++ hurd-debian/libtrivfs/demuxer.c    2012-06-05 05:02:02.000000000 +0000
+@@ -26,11 +26,13 @@
+               mach_msg_header_t *outp)
+ {
+   int trivfs_fs_server (mach_msg_header_t *, mach_msg_header_t *);
++  int trivfs_fs_experimental_server (mach_msg_header_t *, mach_msg_header_t 
*);
+   int trivfs_io_server (mach_msg_header_t *, mach_msg_header_t *);
+   int trivfs_fsys_server (mach_msg_header_t *, mach_msg_header_t *);
+   
+   return (trivfs_io_server (inp, outp)
+         || trivfs_fs_server (inp, outp)
++        || trivfs_fs_experimental_server (inp, outp)
+         || ports_notify_server (inp, outp)
+         || trivfs_fsys_server (inp, outp)
+         || ports_interrupt_server (inp, outp));
+Index: hurd-debian/configure.in
+===================================================================
+--- hurd-debian.orig/configure.in      2012-06-05 05:02:02.000000000 +0000
++++ hurd-debian/configure.in   2012-06-05 05:06:02.000000000 +0000
+@@ -161,7 +161,7 @@
+ AC_SUBST(VERSIONING)
+ 
+ # Check if libc contains getgrouplist and/or uselocale.
+-AC_CHECK_FUNCS(getgrouplist uselocale)
++AC_CHECK_FUNCS(getgrouplist uselocale file_exec_file_name exec_exec_file_name)
+ 
+ 
+ # From glibc HEAD, 2007-11-07.
+Index: hurd-debian/libtrivfs/trivfs.h
+===================================================================
+--- hurd-debian.orig/libtrivfs/trivfs.h        2012-06-05 05:01:41.000000000 
+0000
++++ hurd-debian/libtrivfs/trivfs.h     2012-06-05 05:02:02.000000000 +0000
+@@ -293,6 +293,7 @@
+ /* These are the MiG-generated headers that declare prototypes
+    for the server functions.  */
+ #include <hurd/trivfs_fs_S.h>
++#include <hurd/trivfs_fs_experimental_S.h>
+ #include <hurd/trivfs_io_S.h>
+ #include <hurd/trivfs_fsys_S.h>
+ 
diff --git a/debian/patches/exec_filename_use.patch 
b/debian/patches/exec_filename_use.patch
new file mode 100644
index 0000000..5a33836
--- /dev/null
+++ b/debian/patches/exec_filename_use.patch
@@ -0,0 +1,113 @@
+From bbce8439190738efc9260490fa52f9dfe9600306 Mon Sep 17 00:00:00 2001
+From: Emilio Pozuelo Monfort <address@hidden>
+Date: Wed, 26 May 2010 23:32:16 +0200
+Subject: [PATCH 3/3] Use the new _hurd_exec_file_name function
+
+* configure.in: Check for _hurd_exec_file_name.
+* utils/fakeauth.c: Call _hurd_exec_file_name instead of
+_hurd_exec if it's available.
+* utils/rpctrace.c: Likewise.
+* utils/shd.c: Likewise.
+---
+ configure.in     |    4 ++--
+ utils/fakeauth.c |    9 +++++++--
+ utils/rpctrace.c |    6 +++++-
+ utils/shd.c      |    9 ++++++---
+ 4 files changed, 20 insertions(+), 8 deletions(-)
+
+Index: hurd-debian/configure.in
+===================================================================
+--- hurd-debian.orig/configure.in      2012-06-05 00:38:18.000000000 +0000
++++ hurd-debian/configure.in   2012-06-05 00:38:18.000000000 +0000
+@@ -160,8 +160,8 @@
+ fi
+ AC_SUBST(VERSIONING)
+ 
+-# Check if libc contains getgrouplist and/or uselocale.
+-AC_CHECK_FUNCS(getgrouplist uselocale file_exec_file_name exec_exec_file_name)
++# Check if libc contains these functions.
++AC_CHECK_FUNCS(getgrouplist uselocale file_exec_file_name exec_exec_file_name 
_hurd_exec_file_name)
+ 
+ 
+ # From glibc HEAD, 2007-11-07.
+Index: hurd-debian/utils/fakeauth.c
+===================================================================
+--- hurd-debian.orig/utils/fakeauth.c  2012-06-05 00:35:35.000000000 +0000
++++ hurd-debian/utils/fakeauth.c       2012-06-05 01:48:00.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* fakeauth -- proxy auth server to lie to users about what their IDs are
+-   Copyright (C) 2002 Free Software Foundation, Inc.
++   Copyright (C) 2002, 2010 Free Software Foundation, Inc.
+ 
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License as
+@@ -388,7 +388,7 @@
+   /* We cannot use fork because it doesn't do the right thing with our send
+      rights that point to our own receive rights, i.e. the new auth port.
+      Since posix_spawn might be implemented with fork (prior to glibc 2.3),
+-     we cannot use that simple interface either.  We use _hurd_exec
++     we cannot use that simple interface either.  We use _hurd_exec_file_name
+      directly to effect what posix_spawn does in the simple case.  */
+   {
+     task_t newtask;
+@@ -413,7 +413,12 @@
+     if (err)
+       error (3, err, "proc_child");
+ 
++#ifdef HAVE__HURD_EXEC_FILE_NAME
++    err = _hurd_exec_file_name (newtask, execfile, argv[argi],
++                              &argv[argi], environ);
++#else
+     err = _hurd_exec (newtask, execfile, &argv[argi], environ);
++#endif
+     mach_port_deallocate (mach_task_self (), newtask);
+     mach_port_deallocate (mach_task_self (), execfile);
+     if (err)
+Index: hurd-debian/utils/rpctrace.c
+===================================================================
+--- hurd-debian.orig/utils/rpctrace.c  2012-06-05 00:35:35.000000000 +0000
++++ hurd-debian/utils/rpctrace.c       2012-06-05 01:48:00.000000000 +0000
+@@ -1069,7 +1069,11 @@
+   /* Now actually run the command they told us to trace.  We do the exec on
+      the actual task, so the RPCs to map in the program itself do not get
+      traced.  Could have an option to use TASK_WRAPPER here instead.  */
++#ifdef HAVE__HURD_EXEC_FILE_NAME
++  err = _hurd_exec_file_name (traced_task, file, *argv, argv, envp);
++#else
+   err = _hurd_exec (traced_task, file, argv, envp);
++#endif
+   if (err)
+     error (2, err, "cannot exec `%s'", argv[0]);
+ 
+Index: hurd-debian/utils/shd.c
+===================================================================
+--- hurd-debian.orig/utils/shd.c       2012-06-05 00:35:35.000000000 +0000
++++ hurd-debian/utils/shd.c    2012-06-05 01:48:00.000000000 +0000
+@@ -1,5 +1,5 @@
+ /*
+-   Copyright (C) 1994,95,99,2002 Free Software Foundation
++   Copyright (C) 1994, 1995, 1999, 2002, 2010 Free Software Foundation
+ 
+    This program is free software; you can redistribute it and/or
+    modify it under the terms of the GNU General Public License as
+@@ -159,15 +159,18 @@
+             movefd (fd1, 1, &save1))
+           return -1;
+ 
++#ifdef HAVE__HURD_EXEC_FILE_NAME
++        err = _hurd_exec_file_name (task, file, program, argv, environ);
++#else
+         err = _hurd_exec (task, file, argv, environ);
+-
++#endif
+         if (restorefd (fd0, 0, &save0) ||
+             restorefd (fd1, 1, &save1))
+           return -1;
+ 
+         if (err)
+           {
+-            error (0, err, "_hurd_exec");
++            error (0, err, "_hurd_exec_file_name");
+             err = task_terminate (task);
+             if (err)
+               error (0, err, "task_terminate");
diff --git a/debian/patches/series b/debian/patches/series
index 767cb79..17e84c9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -48,3 +48,7 @@ libdde_fixes.patch
 libdde_rx_queue.patch
 libdde_rcu.patch
 libmachdev.patch
+exec_filename_exec.patch
+exec_filename_fs.patch
+exec_filename_use.patch
+balloc.patch

-- 
Debian GNU Hurd packaging



reply via email to

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