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

[glibc] 02/02: Revert "hurd: fix /proc/pid/exe being an absolute path."



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

sthibault pushed a commit to branch sid
in repository glibc.

commit 67b8345b732f679ea6fdf1213f12c518fb95aaa7
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Mon Sep 18 20:51:36 2017 +0200

    Revert "hurd: fix /proc/pid/exe being an absolute path."
    
    This reverts commit 49d5642155d35fa19e8f9c6340d3f4b1e1360b00.
    
    For now, because some scripts expect to see their actual call name in
    $0, and not the completely resolved realpath.
---
 debian/changelog                                   |  4 ---
 .../patches/hurd-i386/submitted-exec_filename.diff | 39 ++++------------------
 2 files changed, 7 insertions(+), 36 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 9069468..dd09bda 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,10 +4,6 @@ glibc (2.24-18) UNRELEASED; urgency=medium
   * libc0.3.symbols.hurd-i386: Update with proc_set/get_exe RPCs.
   * patches/hurd-i386/tg-hurdsig-SA_SIGINFO.diff: Always define SA_SIGINFO.
 
-  [ Svante Signell ]
-  * patches/hurd-i386/submitted-exec_filename.diff: Update to fix
-    /proc/pid/exe being an absolute path.
-
  -- Aurelien Jarno <aurel32@debian.org>  Sat, 26 Aug 2017 11:11:58 +0200
 
 glibc (2.24-17) unstable; urgency=medium
diff --git a/debian/patches/hurd-i386/submitted-exec_filename.diff b/debian/patches/hurd-i386/submitted-exec_filename.diff
index f5e46d5..a364ba1 100644
--- a/debian/patches/hurd-i386/submitted-exec_filename.diff
+++ b/debian/patches/hurd-i386/submitted-exec_filename.diff
@@ -189,33 +189,16 @@ from argv[0] but argv[0] only contains the executable name by convention.
 +#endif
 --- a/sysdeps/mach/hurd/execve.c
 +++ b/sysdeps/mach/hurd/execve.c
-@@ -18,6 +18,7 @@
- #include <unistd.h>
- #include <hurd.h>
- #include <fcntl.h>
-+#include <stdlib.h>
- 
- /* Replace the current process, executing FILE_NAME with arguments ARGV and
-    environment ENVP.  ARGV and ENVP are terminated by NULL pointers.  */
-@@ -31,11 +31,17 @@ __execve (const char *file_name, char *c
-   if (file == MACH_PORT_NULL)
+@@ -31,7 +31,8 @@ __execve (const char *file_name, char *c
      return -1;
-
-+  char *abs_path = realpath (file_name, NULL);
-+  if (abs_path == NULL)
-+    return -1;
-+
+ 
    /* Hopefully this will not return.  */
 -  err = _hurd_exec (__mach_task_self (), file, argv, envp);
 +  err = _hurd_exec_file_name (__mach_task_self (), file,
-+			      abs_path, argv, envp);
++			      file_name, argv, envp);
  
    /* Oh well.  Might as well be tidy.  */
    __mach_port_deallocate (__mach_task_self (), file);
-+  free(abs_path);
- 
-   return __hurd_fail (err);
- }
 --- a/sysdeps/mach/hurd/fexecve.c
 +++ b/sysdeps/mach/hurd/fexecve.c
 @@ -25,8 +25,9 @@
@@ -244,7 +227,7 @@ from argv[0] but argv[0] only contains the executable name by convention.
  {
    pid_t new_pid;
    char *path, *p, *name;
-+  const char *filename, *abs_path = NULL;
++  const char *filename;
    size_t len;
    size_t pathlen;
    short int flags;
@@ -271,20 +254,12 @@ from argv[0] but argv[0] only contains the executable name by convention.
       except that all errors will be detected here (in the parent process)
       and return proper errno codes rather than the child dying with 127.
  
-@@ -546,8 +548,14 @@ __spawni (pid_t *pid, const char *file,
-      etc) can be observed before what errors.  */
+@@ -546,7 +548,7 @@ __spawni (pid_t *pid, const char *file,
  
    if ((xflags & SPAWN_XFLAGS_USE_PATH) == 0 || strchr (file, '/') != NULL)
--    /* The FILE parameter is actually a path.  */
+     /* The FILE parameter is actually a path.  */
 -    err = child_lookup (file, O_EXEC, 0, &execfile);
-+    {
-+      /* The FILE parameter is actually a path.  */
-+      abs_path = realpath (file, NULL);
-+      if (abs_path == NULL)
-+        goto out;
-+      err = child_lookup (file, O_EXEC, 0, &execfile);
-+      filename = abs_path;
-+    }
++    err = child_lookup (filename = file, O_EXEC, 0, &execfile);
    else
      {
        /* We have to search for FILE on the path.  */

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


Reply to: