summaryrefslogtreecommitdiff
path: root/libnetfs/file-exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnetfs/file-exec.c')
-rw-r--r--libnetfs/file-exec.c71
1 files changed, 62 insertions, 9 deletions
diff --git a/libnetfs/file-exec.c b/libnetfs/file-exec.c
index 638f0ae8..8153b1f4 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.
+ 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.
@@ -49,6 +50,41 @@ netfs_S_file_exec (struct protid *cred,
mach_port_t *destroynames,
size_t destroynameslen)
{
+ return netfs_S_file_exec_paths (cred,
+ task,
+ flags,
+ "",
+ "",
+ argv, argvlen,
+ envp, envplen,
+ fds, fdslen,
+ portarray, portarraylen,
+ intarray, intarraylen,
+ deallocnames, deallocnameslen,
+ destroynames, destroynameslen);
+}
+
+kern_return_t
+netfs_S_file_exec_paths (struct protid *cred,
+ task_t task,
+ int flags,
+ char *path,
+ char *abspath,
+ 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 +169,31 @@ netfs_S_file_exec (struct protid *cred,
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_PATHS
+ err = exec_exec_paths (_netfs_exec,
+ right, MACH_MSG_TYPE_COPY_SEND,
+ task, flags, path, abspath,
+ 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);
}