local-exec_filename
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Fri, 20 Sep 2019 19:39:03 +0000 (20:39 +0100)
committerAurelien Jarno <aurel32@debian.org>
Fri, 20 Sep 2019 19:39:03 +0000 (20:39 +0100)
Keep compatibility with experimental implementation

Gbp-Pq: Topic hurd-i386
Gbp-Pq: Name local-exec_filename.diff

hurd/Makefile
hurd/Versions
hurd/hurdexec.c
sysdeps/mach/hurd/i386/libc.abilist
sysdeps/mach/hurd/spawni.c

index 849179d3399834ee062d13634e8ff28532961c43..7ec7881c0f0d24d81cf2ecd08edb8bc9ac9294d4 100644 (file)
@@ -32,8 +32,8 @@ user-interfaces               := $(addprefix hurd/,\
                                       auth auth_request auth_reply startup \
                                       process process_request \
                                       msg msg_reply msg_request \
-                                      exec exec_startup crash interrupt \
-                                      fs fsys io io_reply io_request \
+                                      exec exec_experimental exec_startup crash interrupt \
+                                      fs fs_experimental fsys io io_reply io_request \
                                       term tioctl socket ifsock \
                                       login password pfinet pci \
                                       )
index b346f9a48cde881442aa31cc904b2da90ef7b1bd..8bbb5dc22aff006b3da1f18668061bae9d986809 100644 (file)
@@ -123,6 +123,10 @@ libc {
     # functions used in macros & inline functions
     __errno_location;
   }
+  GLIBC_2.21 {
+    # "quasi-internal" functions
+    _hurd_exec_file_name;
+  }
   GLIBC_2.26 {
     # "quasi-internal" functions
     _hurd_exec_paths;
index 355c6da1b8d48a35db918d7aaf4c3a023e9e367f..37f8e202f9f54bc12b87ef555bd7202e1b82fc57 100644 (file)
 #include <hurd/fd.h>
 #include <hurd/signal.h>
 #include <hurd/id.h>
+#include <hurd/fs_experimental.h>
 #include <assert.h>
 #include <argz.h>
 
+#include <shlib-compat.h>
+
 /* Overlay TASK, executing FILE with arguments ARGV and environment ENVP.
    If TASK == mach_task_self (), some ports are dealloc'd by the exec server.
    ARGV and ENVP are terminated by NULL pointers.
@@ -39,6 +42,13 @@ _hurd_exec (task_t task, file_t file,
   return _hurd_exec_paths (task, file, NULL, NULL, argv, envp);
 }
 
+error_t
+__hurd_exec_file_name (task_t task, file_t file, const char *filename,
+           char *const argv[], char *const envp[])
+{
+  return _hurd_exec_paths (task, file, filename, filename, argv, envp);
+}
+
 link_warning (_hurd_exec,
              "_hurd_exec is deprecated, use _hurd_exec_paths instead");
 
@@ -392,6 +402,19 @@ _hurd_exec_paths (task_t task, file_t file,
                               task == __mach_task_self () ? 1 : 0);
       /* Fall back for backwards compatibility.  This can just be removed
          when __file_exec goes away.  */
+      if (err == MIG_BAD_ID)
+       err = __file_exec_file_name (file, task, flags,
+                                   path ? path : "",
+                                   args, argslen, env, envlen,
+                                   dtable, MACH_MSG_TYPE_COPY_SEND, dtablesize,
+                                   ports, MACH_MSG_TYPE_COPY_SEND,
+                                   _hurd_nports,
+                                   ints, INIT_INT_MAX,
+                                   please_dealloc, pdp - please_dealloc,
+                                   &_hurd_msgport,
+                                   task == __mach_task_self () ? 1 : 0);
+      /* Fall back for backwards compatibility.  This can just be removed
+         when __file_exec goes away.  */
       if (err == MIG_BAD_ID)
        err = __file_exec (file, task, flags,
                           args, argslen, env, envlen,
@@ -436,3 +459,9 @@ _hurd_exec_paths (task_t task, file_t file,
   return err;
 }
 libc_hidden_def (_hurd_exec_paths)
+extern error_t _hurd_exec_file_name (task_t task,
+                                    file_t file,
+                                    const char *filename,
+                                    char *const argv[],
+                                    char *const envp[]);
+versioned_symbol (libc, __hurd_exec_file_name, _hurd_exec_file_name, GLIBC_2_21);
index 2bd55987ae542bd3471306b83aa65935787b07ca..1256b0b9ce411a5e3de81d1c65583684758deb84 100644 (file)
@@ -1979,6 +1979,7 @@ GLIBC_2.2.6 xprt_register F
 GLIBC_2.2.6 xprt_unregister F
 GLIBC_2.21 __mach_host_self_ D 0x4
 GLIBC_2.21 __pthread_get_cleanup_stack F
+GLIBC_2.21 _hurd_exec_file_name F
 GLIBC_2.21 _hurd_sigstate_delete F
 GLIBC_2.21 _hurd_sigstate_lock F
 GLIBC_2.21 _hurd_sigstate_pending F
index c72a9776562929ec262fdc43dde010bcf83dc613..6aecbc55f6b154d869b113723d52597bf959b2b5 100644 (file)
@@ -30,6 +30,7 @@
 #include <hurd/id.h>
 #include <hurd/lookup.h>
 #include <hurd/resource.h>
+#include <hurd/fs_experimental.h>
 #include <assert.h>
 #include <argz.h>
 #include "spawn_int.h"
@@ -772,6 +773,18 @@ __spawni (pid_t *pid, const char *file,
           ints, INIT_INT_MAX,
           NULL, 0, NULL, 0);
 
+       /* Fallback for backwards compatibility.  This can just be removed
+          when __file_exec goes away.  */
+       if (err == MIG_BAD_ID)
+         err = __file_exec_file_name
+         (file, task,
+          __sigismember (&_hurdsig_traced, SIGKILL) ? EXEC_SIGTRAP : 0,
+          relpath, args, argslen, env, envlen,
+          dtable, MACH_MSG_TYPE_COPY_SEND, dtablesize,
+          ports, MACH_MSG_TYPE_COPY_SEND, _hurd_nports,
+          ints, INIT_INT_MAX,
+          NULL, 0, NULL, 0);
+
        /* Fallback for backwards compatibility.  This can just be removed
           when __file_exec goes away.  */
        if (err == MIG_BAD_ID)