File: local-exec_filename.diff

package info (click to toggle)
glibc 2.36-9%2Bdeb12u13
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-proposed-updates
  • size: 300,148 kB
  • sloc: ansic: 1,055,755; asm: 324,942; makefile: 15,198; python: 12,603; sh: 10,884; cpp: 5,685; awk: 1,883; perl: 518; yacc: 292; pascal: 182; sed: 39
file content (143 lines) | stat: -rw-r--r-- 5,223 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
Keep compatibility with experimental implementation

---
 hurd/Makefile                       |    4 ++--
 hurd/Versions                       |    4 ++++
 hurd/hurdexec.c                     |   29 +++++++++++++++++++++++++++++
 sysdeps/mach/hurd/i386/libc.abilist |    1 +
 sysdeps/mach/hurd/spawni.c          |   13 +++++++++++++
 5 files changed, 49 insertions(+), 2 deletions(-)

Index: glibc-2.33/hurd/Makefile
===================================================================
--- glibc-2.33.orig/hurd/Makefile
+++ glibc-2.33/hurd/Makefile
@@ -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: glibc-2.33/hurd/Versions
===================================================================
--- glibc-2.33.orig/hurd/Versions
+++ glibc-2.33/hurd/Versions
@@ -120,6 +120,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: glibc-2.33/hurd/hurdexec.c
===================================================================
--- glibc-2.33.orig/hurd/hurdexec.c
+++ glibc-2.33/hurd/hurdexec.c
@@ -25,9 +25,12 @@
 #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");
 
@@ -430,6 +440,18 @@ retry:
       /* 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,
 			   dtable, MACH_MSG_TYPE_COPY_SEND, dtablesize,
@@ -475,3 +498,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: glibc-2.33/sysdeps/mach/hurd/spawni.c
===================================================================
--- glibc-2.33.orig/sysdeps/mach/hurd/spawni.c
+++ glibc-2.33/sysdeps/mach/hurd/spawni.c
@@ -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"
@@ -784,6 +785,18 @@ retry:
 	   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)
+	  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
Index: glibc-2.33/sysdeps/mach/hurd/i386/libc.abilist
===================================================================
--- glibc-2.33.orig/sysdeps/mach/hurd/i386/libc.abilist
+++ glibc-2.33/sysdeps/mach/hurd/i386/libc.abilist
@@ -1946,6 +1946,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