local-exec_filename
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Tue, 24 Sep 2024 19:46:16 +0000 (21:46 +0200)
committerAurelien Jarno <aurel32@debian.org>
Tue, 24 Sep 2024 19:46:16 +0000 (21:46 +0200)
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
sysdeps/mach/hurd/x86_64/libc.abilist

index 60df3c5bb56d82b64120bc722e912f19ce8e002f..c35b343e4498459de1aae29ab5698e8bb54ac0ac 100644 (file)
@@ -49,8 +49,10 @@ user-interfaces := \
   hurd/auth_request \
   hurd/crash \
   hurd/exec \
+  hurd/exec_experimental \
   hurd/exec_startup \
   hurd/fs \
+  hurd/fs_experimental \
   hurd/fsys \
   hurd/ifsock \
   hurd/interrupt \
index 439e8abf32a352f62d2ad262475215b9dec04f63..d3410232e7f0edb5dff71f525076e783edff50ce 100644 (file)
@@ -117,6 +117,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 8cb9d5155a0775bd146c6915dc54fcdfd2573a5c..3da2df83bb011fc6be7cf9ec82a762e3fedda521 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");
 
@@ -441,6 +451,18 @@ retry:
                               portnames, nportnames);
       /* 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,
+                                   portnames, nportnames);
+      /* 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,
@@ -489,3 +511,9 @@ retry:
   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 402d109fecac6929d5a43aeb8e476e81baeb415f..bb2569174762f5306e97323e77fa68568259472f 100644 (file)
@@ -1985,6 +1985,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 pthread_attr_destroy F
 GLIBC_2.21 pthread_attr_getdetachstate F
 GLIBC_2.21 pthread_attr_getinheritsched F
index 727c2e20c457fd006f2bba7faca6c13a17ca2ae3..b23663dee5a900e063b71bfa8e5515cad76ee06a 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"
@@ -832,6 +833,18 @@ retry:
           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)
index 03abc002e865509fb2784b0acbd15e0c2b58b924..a4f67ed24e8230eb5e72e9d86fd5011539233cca 100644 (file)
@@ -572,6 +572,7 @@ GLIBC_2.38 _hurd_dtable_lock D 0x28
 GLIBC_2.38 _hurd_dtablesize D 0x4
 GLIBC_2.38 _hurd_exception2signal F
 GLIBC_2.38 _hurd_exec F
+GLIBC_2.38 _hurd_exec_file_name F
 GLIBC_2.38 _hurd_exec_paths F
 GLIBC_2.38 _hurd_fd_error F
 GLIBC_2.38 _hurd_fd_error_signal F