commit-hurd
[Top][All Lists]
Advanced

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

[hurd] 01/01: rpctrace: Pass prefixed_name to _hurd_exec_file_name


From: Samuel Thibault
Subject: [hurd] 01/01: rpctrace: Pass prefixed_name to _hurd_exec_file_name
Date: Fri, 26 Aug 2016 18:22:29 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch master
in repository hurd.

commit 330c4a378da7fa5d7628f4275dabafdac2d5ecc0
Author: Kalle Olavi Niemitalo <address@hidden>
Date:   Fri Aug 26 20:04:19 2016 +0200

    rpctrace: Pass prefixed_name to _hurd_exec_file_name
    
    Closes: Bug#835513
---
 debian/changelog                            |  8 ++++
 debian/patches/exec_filename_rpctrace.patch | 61 +++++++++++++++++++++++++++++
 debian/patches/series                       |  1 +
 3 files changed, 70 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 121dd94..1ade7c0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+hurd (1:0.8.git20160826-2) UNRELEASED; urgency=medium
+
+  [ Kalle Olavi Niemitalo ]
+  * patches/exec_filename_rpctrace.patch: rpctrace: Pass prefixed_name to
+    _hurd_exec_file_name. Closes: Bug#835513.
+
+ -- Samuel Thibault <address@hidden>  Fri, 26 Aug 2016 19:55:57 +0200
+
 hurd (1:0.8.git20160826-1) unstable; urgency=medium
 
   * New upstream snapshot, fixes loading small pic programs.
diff --git a/debian/patches/exec_filename_rpctrace.patch 
b/debian/patches/exec_filename_rpctrace.patch
new file mode 100644
index 0000000..d15f9bf
--- /dev/null
+++ b/debian/patches/exec_filename_rpctrace.patch
@@ -0,0 +1,61 @@
+From: Kalle Olavi Niemitalo <address@hidden>
+To: address@hidden
+Date: Fri, 26 Aug 2016 17:23:28 +0300
+Subject: [PATCH] rpctrace: Pass prefixed_name to _hurd_exec_file_name.
+
+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_file_name.
+
+diff --git a/utils/rpctrace.c b/utils/rpctrace.c
+index 95ff124..10843bc 100644
+--- a/utils/rpctrace.c
++++ b/utils/rpctrace.c
+@@ -1622,8 +1622,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]);
+@@ -1664,7 +1665,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_FILE_NAME
+-  err = _hurd_exec_file_name (traced_task, file, *argv, argv, envp);
++  err = _hurd_exec_file_name (traced_task, file, prefixed_name ?: *argv,
++                            argv, envp);
+ #else
+   err = _hurd_exec (traced_task, file, argv, envp);
+ #endif
+@@ -1675,6 +1677,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;
+ }
+ 
+-- 
+2.6.4
+
+
diff --git a/debian/patches/series b/debian/patches/series
index 4198bd7..6380222 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -28,3 +28,4 @@ crash-logging.patch
 using_std.patch
 netdde_log.patch
 libports-iterate-refcount.patch
+exec_filename_rpctrace.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

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