[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 13/16: rpctrace: Pass prefixed_name to _hurd_exec_paths.
From: |
Samuel Thibault |
Subject: |
[hurd] 13/16: rpctrace: Pass prefixed_name to _hurd_exec_paths. |
Date: |
Tue, 09 Jan 2018 01:35:30 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 5dbe5dfd27633ebf2cc0e37fa7036fb1a689ef81
Author: Kalle Olavi Niemitalo <address@hidden>
Date: Fri Aug 26 17:23:28 2016 +0300
rpctrace: Pass prefixed_name to _hurd_exec_paths.
This fixes the following test case:
mkdir testy
echo '#! /bin/bash' > testy/prog
echo 'printf "%s\n" "$0"' >> testy/prog
chmod +x testy/prog
PATH=$(pwd)/testy /bin/rpctrace -E PATH=/usr/bin:/bin -o /dev/null prog
Before this patch, the output is:
/bin/bash: prog: No such file or directory
After this patch, the output is similar to:
/home/kalle/testy/prog
* utils/rpctrace.c (traced_spawn): Get prefixed_name from
file_name_path_lookup and pass it to _hurd_exec_paths.
---
utils/rpctrace.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/utils/rpctrace.c b/utils/rpctrace.c
index 1690ae1..b4de175 100644
--- a/utils/rpctrace.c
+++ b/utils/rpctrace.c
@@ -1620,8 +1620,9 @@ traced_spawn (char **argv, char **envp)
task_t traced_task;
struct sender_info *ti;
struct receiver_info *receive_ti;
+ char *prefixed_name;
file_t file = file_name_path_lookup (argv[0], getenv ("PATH"),
- O_EXEC, 0, 0);
+ O_EXEC, 0, &prefixed_name);
if (file == MACH_PORT_NULL)
error (1, errno, "command not found: %s", argv[0]);
@@ -1662,7 +1663,8 @@ traced_spawn (char **argv, char **envp)
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_PATHS
- err = _hurd_exec_paths (traced_task, file, *argv, *argv, argv, envp);
+ err = _hurd_exec_paths (traced_task, file, prefixed_name ?: *argv,
+ prefixed_name ?: *argv, argv, envp);
#else
err = _hurd_exec (traced_task, file, argv, envp);
#endif
@@ -1673,6 +1675,7 @@ traced_spawn (char **argv, char **envp)
cannot die and hence our TRACED_TASK ref cannot have been released. */
mach_port_deallocate (mach_task_self (), task_wrapper);
+ free (prefixed_name);
return pid;
}
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] branch upstream updated (83fef6c -> 104f312), Samuel Thibault, 2018/01/08
- [hurd] 07/16: libfshelp/get-identity.c: Avoid spurious ihash removal, Samuel Thibault, 2018/01/08
- [hurd] 09/16: libfshelp/get-identity.c: Simplify checking weak references, Samuel Thibault, 2018/01/08
- [hurd] 06/16: libfshelp/get-identity: Use 64bit hashing for inodes, Samuel Thibault, 2018/01/08
- [hurd] 08/16: libihash: Make sure we do not remove a locp several times, Samuel Thibault, 2018/01/08
- [hurd] 02/16: Record executable entry for PIE core dumps, Samuel Thibault, 2018/01/08
- [hurd] 04/16: libfshelp: Add weak reference for hash table reference, Samuel Thibault, 2018/01/08
- [hurd] 13/16: rpctrace: Pass prefixed_name to _hurd_exec_paths.,
Samuel Thibault <=
- [hurd] 05/16: libfshelp/get-identity.c: add FIXME, Samuel Thibault, 2018/01/08
- [hurd] 01/16: Reserve IDs for proc_set_exe and proc_get_exe, Samuel Thibault, 2018/01/08
- [hurd] 12/16: Use the new _hurd_exec_file_name function, Samuel Thibault, 2018/01/08
- [hurd] 16/16: Implement /proc/<pid>/exe, Samuel Thibault, 2018/01/08
- [hurd] 14/16: Fix exec_paths through fakeroot or chroot, Samuel Thibault, 2018/01/08
- [hurd] 10/16: Add a new exec_exec_paths RPC, Samuel Thibault, 2018/01/08
- [hurd] 15/16: Add support for $ORIGIN rpath expansion, Samuel Thibault, 2018/01/08
- [hurd] 11/16: Add a file_exec_file_name RPC, Samuel Thibault, 2018/01/08
- [hurd] 03/16: lwip: Add LwIP-based TCP/IP translator, Samuel Thibault, 2018/01/08