diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-09-11 10:06:46 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2015-09-11 10:06:46 +0200 |
commit | 5aa4dbd82f3785f49a844046e15e50b62c71809c (patch) | |
tree | d223f774fe528ba61e733fb546a6a9b6450922ab | |
parent | cef1e5f25bd59e54002ac281db3004c618284de2 (diff) |
rebased patch
-rw-r--r-- | debian/patches/exec_filename_fs.patch | 735 |
1 files changed, 329 insertions, 406 deletions
diff --git a/debian/patches/exec_filename_fs.patch b/debian/patches/exec_filename_fs.patch index d1e96cd7..98ab915a 100644 --- a/debian/patches/exec_filename_fs.patch +++ b/debian/patches/exec_filename_fs.patch @@ -1,34 +1,8 @@ -From ba528e4a9db131112aa09edfdbb3449b55618578 Mon Sep 17 00:00:00 2001 -From: Emilio Pozuelo Monfort <pochu27@gmail.com> -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 ++-- - startup/startup.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 -+++ hurd-debian/TODO -@@ -133,7 +133,7 @@ See `tasks', the exported task list. +diff --git a/TODO b/TODO +index de2a199..9fdb86f 100644 +--- a/TODO ++++ b/TODO +@@ -131,7 +131,7 @@ See `tasks', the exported task list. ** libtrivfs *** Allow for read/write/exec to be passed down. @@ -37,10 +11,23 @@ Index: hurd-debian/TODO *** 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 -+++ hurd-debian/doc/hurd.texi +diff --git a/configure.ac b/configure.ac +index b03057b..b3abe1a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -162,6 +162,8 @@ else + VERSIONING=no + fi + AC_SUBST(VERSIONING) ++# Check if libc contains these functions. ++AC_CHECK_FUNCS(file_exec_file_name exec_exec_file_name) + + + # From glibc HEAD, 2007-11-07. +diff --git a/doc/hurd.texi b/doc/hurd.texi +index 2f36bdc..015eafb 100644 +--- a/doc/hurd.texi ++++ b/doc/hurd.texi @@ -2737,10 +2737,10 @@ write the file. @node Program Execution @subsection Program Execution @@ -55,7 +42,7 @@ Index: hurd-debian/doc/hurd.texi ports are necessary for setuid execution, and then invoke the standard execserver found on @file{/servers/exec}. -@@ -2752,13 +2752,13 @@ The file must be opened for execution; i +@@ -2752,13 +2752,13 @@ The file must be opened for execution; if it is not, @code{EBADF} should 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 @@ -73,20 +60,22 @@ Index: hurd-debian/doc/hurd.texi it is not acceptable to return an error; in such a case the server should simply silently fail to implement the setuid/setgid semantics. -@@ -2773,7 +2773,7 @@ will not share any file pointers with th +@@ -2772,8 +2772,8 @@ 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 - @code{exec_exec_file_name}. Whatever error code @code{exec_exec_file_name} --returns should be returned to the caller of @code{file_exec}. +-@code{exec_exec}. Whatever error code @code{exec_exec} returns should +-returned to the caller of @code{file_exec}. ++@code{exec_exec_file_name}. Whatever error code @code{exec_exec_file_name} +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 -+++ hurd-debian/exec/hashexec.c -@@ -24,6 +24,9 @@ the Free Software Foundation, 675 Mass A +diff --git a/exec/hashexec.c b/exec/hashexec.c +index e53d2ee..36fcfb7 100644 +--- a/exec/hashexec.c ++++ b/exec/hashexec.c +@@ -23,6 +23,9 @@ #include <unistd.h> #include <envz.h> #include <sys/param.h> @@ -96,7 +85,7 @@ Index: hurd-debian/exec/hashexec.c /* This is called to check E for a #! interpreter specification. E has already been prepared (successfully) and checked (unsuccessfully). If -@@ -421,16 +424,32 @@ check_hashbang (struct execdata *e, +@@ -415,16 +418,32 @@ check_hashbang (struct execdata *e, /* We cannot open the interpreter file to execute it. Lose! */ return; @@ -138,10 +127,10 @@ Index: hurd-debian/exec/hashexec.c mach_port_deallocate (mach_task_self (), interp_file); munmap (new_argv, new_argvlen); -Index: hurd-debian/hurd/fs.defs -=================================================================== ---- hurd-debian.orig/hurd/fs.defs -+++ hurd-debian/hurd/fs.defs +diff --git a/hurd/fs.defs b/hurd/fs.defs +index a4a48cc..1322237 100644 +--- a/hurd/fs.defs ++++ b/hurd/fs.defs @@ -1,5 +1,6 @@ /* Definitions for the filesystem interface. - Copyright (C) 1994,95,96,97,98,99,2002 Free Software Foundation, Inc. @@ -171,10 +160,10 @@ Index: hurd-debian/hurd/fs.defs written directly. */ routine file_check_access ( file: file_t; -Index: hurd-debian/hurd/hurd_types.h -=================================================================== ---- hurd-debian.orig/hurd/hurd_types.h -+++ hurd-debian/hurd/hurd_types.h +diff --git a/hurd/hurd_types.h b/hurd/hurd_types.h +index 4341177..83942a7 100644 +--- a/hurd/hurd_types.h ++++ b/hurd/hurd_types.h @@ -1,5 +1,6 @@ /* C declarations for Hurd server interfaces - Copyright (C) 1993,94,95,96,98,99,2001,02 Free Software Foundation, Inc. @@ -210,139 +199,32 @@ Index: hurd-debian/hurd/hurd_types.h enum { INIT_UMASK, -Index: hurd-debian/startup/startup.c -=================================================================== ---- hurd-debian.orig/startup/startup.c -+++ hurd-debian/startup/startup.c -@@ -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, 2013 Free Software Foundation, Inc. -+ 2005, 2008, 2010, 2013 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> -@@ -376,12 +379,27 @@ run (const char *server, mach_port_t *po - 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; +diff --git a/libdiskfs/Makefile b/libdiskfs/Makefile +index 47b9339..6646dbe 100644 +--- a/libdiskfs/Makefile ++++ b/libdiskfs/Makefile +@@ -56,7 +56,7 @@ OTHERSRCS = conch-fetch.c conch-set.c dir-clear.c dir-init.c dir-renamed.c \ + SRCS = $(OTHERSRCS) $(FSSRCS) $(IOSRCS) $(FSYSSRCS) $(IFSOCKSRCS) + installhdrs = diskfs.h diskfs-pager.h -@@ -469,14 +487,27 @@ run_for_real (char *filename, char *args - ++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) -@@ -1035,13 +1066,26 @@ start_child (const char *prog, char **pr - getchar (); - } +-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)) +@@ -66,6 +66,7 @@ LDLIBS += -lpthread -- 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); -+ - proc_mark_important (default_ports[INIT_PORT_PROC]); - mach_port_deallocate (mach_task_self (), default_ports[INIT_PORT_PROC]); - mach_port_deallocate (mach_task_self (), file); -Index: hurd-debian/libdiskfs/boot-start.c -=================================================================== ---- hurd-debian.orig/libdiskfs/boot-start.c -+++ hurd-debian/libdiskfs/boot-start.c -@@ -209,7 +209,7 @@ diskfs_start_bootstrap () + 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 + exec_startup-MIGSFLAGS = -imacros $(srcdir)/fsmutations.h +diff --git a/libdiskfs/boot-start.c b/libdiskfs/boot-start.c +index d10d783..d80a4ca 100644 +--- a/libdiskfs/boot-start.c ++++ b/libdiskfs/boot-start.c +@@ -198,7 +198,7 @@ diskfs_start_bootstrap () diskfs_exec_ctl = MACH_PORT_NULL; /* Not used after this. */ } @@ -351,10 +233,30 @@ Index: hurd-debian/libdiskfs/boot-start.c _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 -+++ hurd-debian/libdiskfs/file-exec.c +diff --git a/libdiskfs/demuxer.c b/libdiskfs/demuxer.c +index 4a1c4fb..ff33b1b 100644 +--- a/libdiskfs/demuxer.c ++++ b/libdiskfs/demuxer.c +@@ -19,6 +19,7 @@ + + #include "io_S.h" + #include "fs_S.h" ++#include "fs_experimental_S.h" + #include "../libports/notify_S.h" + #include "fsys_S.h" + #include "../libports/interrupt_S.h" +@@ -33,6 +34,7 @@ diskfs_demuxer (mach_msg_header_t *inp, + mig_routine_t routine; + if ((routine = diskfs_io_server_routine (inp)) || + (routine = diskfs_fs_server_routine (inp)) || ++ (routine = diskfs_fs_experimental_server_routine (inp)) || + (routine = ports_notify_server_routine (inp)) || + (routine = diskfs_fsys_server_routine (inp)) || + (routine = ports_interrupt_server_routine (inp)) || +diff --git a/libdiskfs/file-exec.c b/libdiskfs/file-exec.c +index e544b14..a491720 100644 +--- a/libdiskfs/file-exec.c ++++ b/libdiskfs/file-exec.c @@ -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. @@ -364,7 +266,7 @@ Index: hurd-debian/libdiskfs/file-exec.c This file is part of the GNU Hurd. -@@ -21,10 +22,14 @@ the Free Software Foundation, 675 Mass A +@@ -21,10 +22,14 @@ #include "priv.h" #include "fs_S.h" @@ -472,10 +374,10 @@ Index: hurd-debian/libdiskfs/file-exec.c 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 -+++ hurd-debian/libfshelp/start-translator-long.c +diff --git a/libfshelp/start-translator-long.c b/libfshelp/start-translator-long.c +index 8b00e08..f0966aa 100644 +--- a/libfshelp/start-translator-long.c ++++ b/libfshelp/start-translator-long.c @@ -1,5 +1,6 @@ /* - Copyright (C) 1995,96,99,2000,02, 04 Free Software Foundation, Inc. @@ -494,7 +396,7 @@ Index: hurd-debian/libfshelp/start-translator-long.c /* The data passed in the various messages we're interested in. */ -@@ -272,12 +276,22 @@ fshelp_start_translator_long (fshelp_ope +@@ -272,12 +276,22 @@ fshelp_start_translator_long (fshelp_open_fn_t underlying_open_fn, saveport = ports[INIT_PORT_BOOTSTRAP]; ports[INIT_PORT_BOOTSTRAP] = bootstrap; @@ -522,10 +424,49 @@ Index: hurd-debian/libfshelp/start-translator-long.c 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 -+++ hurd-debian/libnetfs/file-exec.c +diff --git a/libnetfs/Makefile b/libnetfs/Makefile +index c3830c0..4aade5a 100644 +--- a/libnetfs/Makefile ++++ b/libnetfs/Makefile +@@ -59,12 +59,13 @@ SRCS= $(OTHERSRCS) $(FSSRCS) $(IOSRCS) $(FSYSSRCS) $(IFSOCKSRCS) + + 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_ +diff --git a/libnetfs/demuxer.c b/libnetfs/demuxer.c +index 4c20ab6..bf78812 100644 +--- a/libnetfs/demuxer.c ++++ b/libnetfs/demuxer.c +@@ -22,6 +22,7 @@ + + #include "io_S.h" + #include "fs_S.h" ++#include "fs_experimental_S.h" + #include "../libports/notify_S.h" + #include "fsys_S.h" + #include "../libports/interrupt_S.h" +@@ -34,6 +35,7 @@ netfs_demuxer (mach_msg_header_t *inp, + mig_routine_t routine; + if ((routine = netfs_io_server_routine (inp)) || + (routine = netfs_fs_server_routine (inp)) || ++ (routine = netfs_fs_experimental_server_routine (inp)) || + (routine = ports_notify_server_routine (inp)) || + (routine = netfs_fsys_server_routine (inp)) || + (routine = ports_interrupt_server_routine (inp)) || +diff --git a/libnetfs/file-exec.c b/libnetfs/file-exec.c +index 638f0ae..ffaf598 100644 +--- a/libnetfs/file-exec.c ++++ b/libnetfs/file-exec.c @@ -1,5 +1,6 @@ /* - Copyright (C) 1996,97,2000,01,02 Free Software Foundation, Inc. @@ -629,10 +570,54 @@ Index: hurd-debian/libnetfs/file-exec.c 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 -+++ hurd-debian/libtrivfs/file-exec.c +diff --git a/libtrivfs/Makefile b/libtrivfs/Makefile +index 48a53d7..c440101 100644 +--- a/libtrivfs/Makefile ++++ b/libtrivfs/Makefile +@@ -44,7 +44,7 @@ OTHERSRCS=demuxer.c protid-clean.c protid-dup.c cntl-create.c \ + + 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 +@@ -54,6 +54,10 @@ MIGCOMSFLAGS = -prefix trivfs_ + installhdrs := trivfs.h + mig-sheader-prefix = trivfs_ + ++ifndef no_deps ++installhdrs += $(patsubst %,trivfs_%_S.h,fs fs_experimental io fsys) ++endif ++ + include ../Makeconf + + $(MIGSTUBS:%Server.o=%.sdefsi): $(srcdir)/mig-mutate.h +diff --git a/libtrivfs/demuxer.c b/libtrivfs/demuxer.c +index 8c1afe6..55229da 100644 +--- a/libtrivfs/demuxer.c ++++ b/libtrivfs/demuxer.c +@@ -23,6 +23,7 @@ + + #include "trivfs_io_S.h" + #include "trivfs_fs_S.h" ++#include "trivfs_fs_experimental_S.h" + #include "../libports/notify_S.h" + #include "trivfs_fsys_S.h" + #include "../libports/interrupt_S.h" +@@ -34,6 +35,7 @@ trivfs_demuxer (mach_msg_header_t *inp, + mig_routine_t routine; + if ((routine = trivfs_io_server_routine (inp)) || + (routine = trivfs_fs_server_routine (inp)) || ++ (routine = trivfs_fs_experimental_server_routine (inp)) || + (routine = ports_notify_server_routine (inp)) || + (routine = trivfs_fsys_server_routine (inp)) || + (routine = ports_interrupt_server_routine (inp))) +diff --git a/libtrivfs/file-exec.c b/libtrivfs/file-exec.c +index b353d8a..5f873c7 100644 +--- a/libtrivfs/file-exec.c ++++ b/libtrivfs/file-exec.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1994,2002 Free Software Foundation, Inc. @@ -640,7 +625,7 @@ Index: hurd-debian/libtrivfs/file-exec.c This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as -@@ -41,3 +41,28 @@ trivfs_S_file_exec (trivfs_protid_t exec +@@ -41,3 +41,28 @@ trivfs_S_file_exec (trivfs_protid_t exec_file, { return EOPNOTSUPP; } @@ -669,10 +654,139 @@ Index: hurd-debian/libtrivfs/file-exec.c +{ + return EOPNOTSUPP; +} -Index: hurd-debian/trans/fakeroot.c -=================================================================== ---- hurd-debian.orig/trans/fakeroot.c -+++ hurd-debian/trans/fakeroot.c +diff --git a/startup/startup.c b/startup/startup.c +index e916768..db30b65 100644 +--- a/startup/startup.c ++++ b/startup/startup.c +@@ -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, 2013 Free Software Foundation, Inc. ++ 2005, 2008, 2010, 2013 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> +@@ -377,13 +380,28 @@ run (const char *server, mach_port_t *ports, task_t *task) + 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; + +@@ -470,14 +488,27 @@ run_for_real (char *filename, char *args, int arglen, mach_port_t ctty, + ++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) +@@ -1075,13 +1106,26 @@ start_child (const char *prog, char **progargs) + 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); ++ + proc_mark_important (default_ports[INIT_PORT_PROC]); + mach_port_deallocate (mach_task_self (), default_ports[INIT_PORT_PROC]); + mach_port_deallocate (mach_task_self (), file); +diff --git a/trans/fakeroot.c b/trans/fakeroot.c +index 76fc901..adbd07d 100644 +--- a/trans/fakeroot.c ++++ b/trans/fakeroot.c @@ -28,10 +28,14 @@ #include <pthread.h> #include <hurd/ihash.h> @@ -688,7 +802,7 @@ Index: hurd-debian/trans/fakeroot.c #include "libnetfs/io_S.h" #include "libnetfs/fsys_S.h" #include "libports/notify_S.h" -@@ -785,23 +789,24 @@ netfs_file_get_storage_info (struct ious +@@ -820,23 +824,24 @@ netfs_file_get_storage_info (struct iouser *cred, } kern_return_t @@ -730,7 +844,7 @@ Index: hurd-debian/trans/fakeroot.c { error_t err; file_t file; -@@ -820,14 +825,30 @@ netfs_S_file_exec (struct protid *user, +@@ -855,14 +860,30 @@ netfs_S_file_exec (struct protid *user, if (!err) { @@ -767,7 +881,7 @@ Index: hurd-debian/trans/fakeroot.c mach_port_deallocate (mach_task_self (), file); } -@@ -843,6 +864,38 @@ netfs_S_file_exec (struct protid *user, +@@ -878,6 +899,38 @@ netfs_S_file_exec (struct protid *user, return err; } @@ -806,7 +920,7 @@ Index: hurd-debian/trans/fakeroot.c error_t netfs_S_io_map (struct protid *user, mach_port_t *rdobj, mach_msg_type_name_t *rdobjtype, -@@ -959,6 +1012,7 @@ netfs_demuxer (mach_msg_header_t *inp, +@@ -994,6 +1047,7 @@ netfs_demuxer (mach_msg_header_t *inp, mig_routine_t routine; if ((routine = netfs_io_server_routine (inp)) || (routine = netfs_fs_server_routine (inp)) || @@ -814,10 +928,10 @@ Index: hurd-debian/trans/fakeroot.c (routine = ports_notify_server_routine (inp)) || (routine = netfs_fsys_server_routine (inp)) || /* XXX we should intercept interrupt_operation and do -Index: hurd-debian/utils/login.c -=================================================================== ---- hurd-debian.orig/utils/login.c -+++ hurd-debian/utils/login.c +diff --git a/utils/login.c b/utils/login.c +index 9ee296a..cc04715 100644 +--- a/utils/login.c ++++ b/utils/login.c @@ -1,6 +1,7 @@ /* Hurdish login @@ -866,194 +980,3 @@ Index: hurd-debian/utils/login.c if (err) error(5, err, "%s", shell); -Index: hurd-debian/hurd/fs_experimental.defs -=================================================================== ---- /dev/null -+++ hurd-debian/hurd/fs_experimental.defs -@@ -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 -+++ hurd-debian/libdiskfs/Makefile -@@ -56,7 +56,7 @@ OTHERSRCS = conch-fetch.c conch-set.c di - 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)) -@@ -66,6 +66,7 @@ LDLIBS += -lpthread - - 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 - exec_startup-MIGSFLAGS = -imacros $(srcdir)/fsmutations.h -Index: hurd-debian/libdiskfs/demuxer.c -=================================================================== ---- hurd-debian.orig/libdiskfs/demuxer.c -+++ hurd-debian/libdiskfs/demuxer.c -@@ -19,6 +19,7 @@ - - #include "io_S.h" - #include "fs_S.h" -+#include "fs_experimental_S.h" - #include "../libports/notify_S.h" - #include "fsys_S.h" - #include "../libports/interrupt_S.h" -@@ -33,6 +34,7 @@ diskfs_demuxer (mach_msg_header_t *inp, - mig_routine_t routine; - if ((routine = diskfs_io_server_routine (inp)) || - (routine = diskfs_fs_server_routine (inp)) || -+ (routine = diskfs_fs_experimental_server_routine (inp)) || - (routine = ports_notify_server_routine (inp)) || - (routine = diskfs_fsys_server_routine (inp)) || - (routine = ports_interrupt_server_routine (inp)) || -Index: hurd-debian/libnetfs/Makefile -=================================================================== ---- hurd-debian.orig/libnetfs/Makefile -+++ hurd-debian/libnetfs/Makefile -@@ -59,12 +59,13 @@ SRCS= $(OTHERSRCS) $(FSSRCS) $(IOSRCS) $ - - 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 -+++ hurd-debian/libnetfs/demuxer.c -@@ -22,6 +22,7 @@ - - #include "io_S.h" - #include "fs_S.h" -+#include "fs_experimental_S.h" - #include "../libports/notify_S.h" - #include "fsys_S.h" - #include "../libports/interrupt_S.h" -@@ -34,6 +35,7 @@ netfs_demuxer (mach_msg_header_t *inp, - mig_routine_t routine; - if ((routine = netfs_io_server_routine (inp)) || - (routine = netfs_fs_server_routine (inp)) || -+ (routine = netfs_fs_experimental_server_routine (inp)) || - (routine = ports_notify_server_routine (inp)) || - (routine = netfs_fsys_server_routine (inp)) || - (routine = ports_interrupt_server_routine (inp)) || -Index: hurd-debian/libtrivfs/Makefile -=================================================================== ---- hurd-debian.orig/libtrivfs/Makefile -+++ hurd-debian/libtrivfs/Makefile -@@ -44,7 +44,7 @@ OTHERSRCS=demuxer.c protid-clean.c proti - - 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 -@@ -54,7 +54,7 @@ MIGCOMSFLAGS = -prefix trivfs_ - 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 -+++ hurd-debian/libtrivfs/demuxer.c -@@ -23,6 +23,7 @@ the Free Software Foundation, 675 Mass A - - #include "trivfs_io_S.h" - #include "trivfs_fs_S.h" -+#include "trivfs_fs_experimental_S.h" - #include "../libports/notify_S.h" - #include "trivfs_fsys_S.h" - #include "../libports/interrupt_S.h" -@@ -34,6 +35,7 @@ trivfs_demuxer (mach_msg_header_t *inp, - mig_routine_t routine; - if ((routine = trivfs_io_server_routine (inp)) || - (routine = trivfs_fs_server_routine (inp)) || -+ (routine = trivfs_fs_experimental_server_routine (inp)) || - (routine = ports_notify_server_routine (inp)) || - (routine = trivfs_fsys_server_routine (inp)) || - (routine = ports_interrupt_server_routine (inp))) -Index: hurd-debian/configure.ac -=================================================================== ---- hurd-debian.orig/configure.ac -+++ hurd-debian/configure.ac -@@ -162,6 +162,8 @@ else - VERSIONING=no - fi - AC_SUBST(VERSIONING) -+# Check if libc contains these functions. -+AC_CHECK_FUNCS(file_exec_file_name exec_exec_file_name) - - - # From glibc HEAD, 2007-11-07. |