From: GNU Libc Maintainers Date: Sun, 14 Jan 2018 10:24:48 +0000 (+0000) Subject: local-exec_filename X-Git-Tag: archive/raspbian/2.26-4+rpi1^2~58 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d40f8ed22f2ae2a94f425d451c8b845d673c3c2c;p=glibc.git local-exec_filename Keep compatibility with experimental implementation Gbp-Pq: Topic hurd-i386 Gbp-Pq: Name local-exec_filename.diff --- diff --git a/hurd/Makefile b/hurd/Makefile index 15f7b14a6..c88533d2e 100644 --- a/hurd/Makefile +++ b/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 \ ) diff --git a/hurd/Versions b/hurd/Versions index 13a740fd0..25538869c 100644 --- a/hurd/Versions +++ b/hurd/Versions @@ -140,7 +140,11 @@ libc { _hurd_sigstate_unlock; _hurd_sigstate_delete; } - GLIBC_2.27 { + GLIBC_2.21 { + # "quasi-internal" functions + _hurd_exec_file_name; + } + GLIBC_2.26 { # "quasi-internal" functions _hurd_exec_paths; } diff --git a/hurd/hurdexec.c b/hurd/hurdexec.c index 51893e1ab..ad56e418d 100644 --- a/hurd/hurdexec.c +++ b/hurd/hurdexec.c @@ -25,9 +25,12 @@ #include #include #include +#include #include #include +#include + /* 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, @@ -435,3 +458,9 @@ _hurd_exec_paths (task_t task, file_t file, free (env); return err; } +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); diff --git a/sysdeps/mach/hurd/spawni.c b/sysdeps/mach/hurd/spawni.c index 3ef5de002..6d53dc192 100644 --- a/sysdeps/mach/hurd/spawni.c +++ b/sysdeps/mach/hurd/spawni.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include "spawn_int.h" @@ -659,6 +660,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)