diff options
author | Emilio Pozuelo Monfort <pochu27@gmail.com> | 2010-05-26 01:27:40 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-01-08 22:46:06 +0100 |
commit | 4152b0ca04f4703a6c6f33e59ba0e7bd95837069 (patch) | |
tree | e10f7b717da381cacf8a5d98087d664f271f3bba /trans | |
parent | 67fa50fb8f0a6894e5ed6534936afb8044e66613 (diff) | |
download | hurd-4152b0ca04f4703a6c6f33e59ba0e7bd95837069.tar.gz hurd-4152b0ca04f4703a6c6f33e59ba0e7bd95837069.tar.bz2 hurd-4152b0ca04f4703a6c6f33e59ba0e7bd95837069.zip |
Add a file_exec_file_name RPC
* hurd/fs.defs (file_exec): Deprecate in favor of...
(file_exec_paths): ...this new RPC.
* TODO: Update.
* doc/hurd.texi: Update RPC name.
* hurd/hurd_types.h: Update RPC name.
* libdiskfs/boot-start.c: Update RPC name.
* configure.ac: Check for presence of RPC stubs file_exec_paths exec_exec_paths.
* exec/hashexec.c (check_hashbang): When file_exec_paths is available, use it
instead of file_exec.
* startup/startup.c (run, run_for_real, start_child): Likewise.
* utils/login.c (main): Likewise.
* libfshelp/start-translator-long.c (fshelp_start_translator_long): Likewise.
* libdiskfs/file-exec.c (diskfs_S_file_exec): Move code to
new function diskfs_S_file_exec_paths and call it.
(diskfs_S_file_exec_paths): New function, use exec_exec_paths when available
instead of exec_exec
* libnetfs/file-exec.c (netfs_S_file_exec, netfs_S_file_exec_paths): Likewise.
* trans/fakeroot.c (netfs_S_file_exec, netfs_S_file_exec_paths): Likewise.
* libtrivfs/file-exec.c (trivfs_S_file_exec_paths): New function.
Diffstat (limited to 'trans')
-rw-r--r-- | trans/fakeroot.c | 97 |
1 files changed, 74 insertions, 23 deletions
diff --git a/trans/fakeroot.c b/trans/fakeroot.c index df47b00f..711a8565 100644 --- a/trans/fakeroot.c +++ b/trans/fakeroot.c @@ -882,23 +882,25 @@ netfs_file_get_storage_info (struct iouser *cred, } kern_return_t -netfs_S_file_exec (struct protid *user, - task_t task, - int flags, - 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) +netfs_S_file_exec_paths (struct protid *user, + 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) { error_t err; file_t file; @@ -917,14 +919,30 @@ netfs_S_file_exec (struct protid *user, if (!err) { +#ifdef HAVE_FILE_EXEC_PATHS /* 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 (netfs_node_netnode (user->po->np)->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_paths (netfs_node_netnode (user->po->np)->file, + 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 + 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); } @@ -940,6 +958,39 @@ netfs_S_file_exec (struct protid *user, return err; } +kern_return_t +netfs_S_file_exec (struct protid *user, + task_t task, + int flags, + 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) +{ + return netfs_S_file_exec_paths (user, + task, + flags, + "", + "", + argv, argvlen, + envp, envplen, + fds, fdslen, + portarray, portarraylen, + intarray, intarraylen, + deallocnames, deallocnameslen, + destroynames, destroynameslen); +} + error_t netfs_S_io_map (struct protid *user, mach_port_t *rdobj, mach_msg_type_name_t *rdobjtype, |