[glibc] 01/01: New upstream snapshot from 20180127:
This is an automated email from the git hooks/post-receive script.
aurel32 pushed a commit to branch glibc-2.27
in repository glibc.
commit 59207df282a6557177ad1b9d69689eaf6bc5c21c
Author: Aurelien Jarno <aurelien@aurel32.net>
Date: Sat Jan 27 14:18:47 2018 +0100
New upstream snapshot from 20180127:
* New upstream snapshot from 20180127:
- Fix stack corruption by __pthread_register_cancel. Closes: #887078,
#887886.
- debian/patches/hurd-i386/local-hurdsig-global-dispositions-version.diff:
rebased.
- debian/patches/hurd-i386/git-exec_filename.diff: upstreamed.
- debian/patches/hurd-i386/tg-faccessat.diff: upstreamed.
- debian/patches/hurd-i386/local-exec_filename.diff: upstreamed.
---
debian/changelog | 11 +-
debian/patches/hurd-i386/git-exec_filename.diff | 372 ----------------
debian/patches/hurd-i386/local-exec_filename.diff | 16 +-
.../local-hurdsig-global-dispositions-version.diff | 29 +-
debian/patches/hurd-i386/tg-faccessat.diff | 490 ---------------------
debian/patches/series | 2 -
6 files changed, 30 insertions(+), 890 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index b839ec2..d25d514 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-glibc (2.26.9000+20180108.401311cf-0experimental1) UNRELEASED; urgency=medium
+glibc (2.26.9000+20180127.7e23a7dd-0experimental1) UNRELEASED; urgency=medium
[ Samuel Thibault ]
* debian/patches/hurd-i386/local-exec_filename.diff: Add glibc 2.26
@@ -6,7 +6,14 @@ glibc (2.26.9000+20180108.401311cf-0experimental1) UNRELEASED; urgency=medium
* debian/patches/hurd-i386/tg-gsync-libc.diff: Update.
[ Aurelien Jarno ]
- *
+ * New upstream snapshot from 20180127:
+ - Fix stack corruption by __pthread_register_cancel. Closes: #887078,
+ #887886.
+ - debian/patches/hurd-i386/local-hurdsig-global-dispositions-version.diff:
+ rebased.
+ - debian/patches/hurd-i386/git-exec_filename.diff: upstreamed.
+ - debian/patches/hurd-i386/tg-faccessat.diff: upstreamed.
+ - debian/patches/hurd-i386/local-exec_filename.diff: upstreamed.
-- Aurelien Jarno <aurel32@debian.org> Mon, 08 Jan 2018 23:27:20 +0100
diff --git a/debian/patches/hurd-i386/git-exec_filename.diff b/debian/patches/hurd-i386/git-exec_filename.diff
deleted file mode 100644
index 8b8ac00..0000000
--- a/debian/patches/hurd-i386/git-exec_filename.diff
+++ /dev/null
@@ -1,372 +0,0 @@
-From d1793416cf8bf6fccd42679a8ec30b0058823ab8 Mon Sep 17 00:00:00 2001
-From: Emilio Pozuelo Monfort <pochu27@gmail.com>
-Date: Sat, 22 May 2010 18:26:29 +0200
-Subject: [hurd,PATCH] Use the new file_exec_paths RPC
-
-Pass the file paths of executable to the exec server, both relative and
-absolute, which exec needs to properly execute and avertise #!-scripts.
-Previously, the exec server tried to guess the name from argv[0] but argv[0]
-only contains the executable name by convention.
-
-2010-08-04 Emilio Pozuelo Monfort <pochu27@gmail.com>
-2017-09-26 Svante Signell <svante.signell@gmail.com>
-
- * hurd/hurdexec.c (_hurd_exec): Deprecate function.
- (_hurd_exec_paths): New function.
- * hurd/hurd.h (_hurd_exec): Deprecate function.
- (_hurd_exec_paths): Declare function.
- * hurd/Versions: Export _hurd_exec_paths.
- * sysdeps/mach/hurd/execve.c: Include <stdlib.h> and <stdio.h>
- (__execve): Use __getcwd to build absolute path, and use
- _hurd_exec_paths instead of _hurd_exec.
- * sysdeps/mach/hurd/spawni.c: Likewise.
- * sysdeps/mach/hurd/fexecve.c: Use _hurd_exec_paths instead of
- _hurd_exec.
-
-
----
- hurd/Makefile | 4 -
- hurd/Versions | 8 +++
- hurd/hurd.h | 12 ++++-
- hurd/hurdexec.c | 63 +++++++++++++++++++++++----
- sysdeps/mach/hurd/execve.c | 34 ++++++++++++++
- sysdeps/mach/hurd/fexecve.c | 5 +-
- sysdeps/mach/hurd/spawni.c | 100 +++++++++++++++++++++++++++++++++-----------
- 7 files changed, 184 insertions(+), 42 deletions(-)
-
-Index: glibc-2.26/hurd/hurdexec.c
-===================================================================
---- glibc-2.26.orig/hurd/hurdexec.c
-+++ glibc-2.26/hurd/hurdexec.c
-@@ -30,11 +30,30 @@
-
- /* 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. */
-+ ARGV and ENVP are terminated by NULL pointers.
-+ Deprecated: use _hurd_exec_paths instead. */
- error_t
- _hurd_exec (task_t task, file_t file,
- char *const argv[], char *const envp[])
- {
-+ return _hurd_exec_paths (task, file, NULL, NULL, argv, envp);
-+}
-+
-+link_warning (_hurd_exec,
-+ "_hurd_exec is deprecated, use _hurd_exec_paths instead");
-+
-+/* 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. PATH is the relative path to
-+ FILE and ABSPATH is the absolute path to FILE. Passing NULL, though possible,
-+ should be avoided, since then the exec server may not know the path to
-+ FILE if FILE is a script, and will then pass /dev/fd/N to the
-+ interpreter. */
-+error_t
-+_hurd_exec_paths (task_t task, file_t file,
-+ const char *path, const char *abspath,
-+ char *const argv[], char *const envp[])
-+{
- error_t err;
- char *args, *env;
- size_t argslen, envlen;
-@@ -216,7 +235,7 @@ _hurd_exec (task_t task, file_t file,
- /* We have euid != svuid or egid != svgid. POSIX.1 says that exec
- sets svuid = euid and svgid = egid. So we must get a new auth
- port and reauthenticate everything with it. We'll pass the new
-- ports in file_exec instead of our own ports. */
-+ ports in file_exec_paths instead of our own ports. */
-
- auth_t newauth;
-
-@@ -360,13 +379,28 @@ _hurd_exec (task_t task, file_t file,
- if (__sigismember (&_hurdsig_traced, SIGKILL))
- flags |= EXEC_SIGTRAP;
- #endif
-- err = __file_exec (file, task, flags,
-- 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);
-+ err = __file_exec_paths (file, task, flags,
-+ path ? path : "",
-+ abspath ? abspath : "",
-+ 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,
-+ 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);
- }
-
- /* Release references to the standard ports. */
-Index: glibc-2.26/hurd/hurd.h
-===================================================================
---- glibc-2.26.orig/hurd/hurd.h
-+++ glibc-2.26/hurd/hurd.h
-@@ -240,12 +240,21 @@ extern FILE *fopenport (io_t port, const
- extern FILE *__fopenport (io_t port, const char *mode);
-
-
--/* Execute a file, replacing TASK's current program image. */
-+/* Deprecated: use _hurd_exec_paths instead. */
-
- extern error_t _hurd_exec (task_t task,
- file_t file,
- char *const argv[],
-- char *const envp[]);
-+ char *const envp[]) __attribute_deprecated__;
-+
-+/* Execute a file, replacing TASK's current program image. */
-+
-+extern error_t _hurd_exec_paths (task_t task,
-+ file_t file,
-+ const char *path,
-+ const char *abspath,
-+ char *const argv[],
-+ char *const envp[]);
-
-
- /* Inform the proc server we have exited with STATUS, and kill the
-Index: glibc-2.26/hurd/Versions
-===================================================================
---- glibc-2.26.orig/hurd/Versions
-+++ glibc-2.26/hurd/Versions
-@@ -140,6 +140,10 @@ libc {
- _hurd_sigstate_unlock;
- _hurd_sigstate_delete;
- }
-+ GLIBC_2.27 {
-+ # "quasi-internal" functions
-+ _hurd_exec_paths;
-+ }
-
- HURD_CTHREADS_0.3 {
- # weak refs to libthreads functions that libc calls iff libthreads in use
-Index: glibc-2.26/sysdeps/mach/hurd/execve.c
-===================================================================
---- glibc-2.26.orig/sysdeps/mach/hurd/execve.c
-+++ glibc-2.26/sysdeps/mach/hurd/execve.c
-@@ -18,6 +18,8 @@
- #include <unistd.h>
- #include <hurd.h>
- #include <fcntl.h>
-+#include <stdlib.h>
-+#include <stdio.h>
-
- /* Replace the current process, executing FILE_NAME with arguments ARGV and
- environment ENVP. ARGV and ENVP are terminated by NULL pointers. */
-@@ -25,16 +27,46 @@ int
- __execve (const char *file_name, char *const argv[], char *const envp[])
- {
- error_t err;
-- file_t file = __file_name_lookup (file_name, O_EXEC, 0);
-+ char *concat_name = NULL;
-+ const char *abs_path;
-
-+ file_t file = __file_name_lookup (file_name, O_EXEC, 0);
- if (file == MACH_PORT_NULL)
- return -1;
-
-+ if (file_name[0] == '/')
-+ {
-+ /* Already an absolute path */
-+ abs_path = file_name;
-+ }
-+ else
-+ {
-+ /* Relative path */
-+ char *cwd = __getcwd (NULL, 0);
-+ if (cwd == NULL)
-+ {
-+ __mach_port_deallocate (__mach_task_self (), file);
-+ return -1;
-+ }
-+
-+ int res = __asprintf (&concat_name, "%s/%s", cwd, file_name);
-+ free (cwd);
-+ if (res == -1)
-+ {
-+ __mach_port_deallocate (__mach_task_self (), file);
-+ return -1;
-+ }
-+
-+ abs_path = concat_name;
-+ }
-+
- /* Hopefully this will not return. */
-- err = _hurd_exec (__mach_task_self (), file, argv, envp);
-+ err = _hurd_exec_paths (__mach_task_self (), file,
-+ file_name, abs_path, argv, envp);
-
- /* Oh well. Might as well be tidy. */
- __mach_port_deallocate (__mach_task_self (), file);
-+ free (concat_name);
-
- return __hurd_fail (err);
- }
-Index: glibc-2.26/sysdeps/mach/hurd/spawni.c
-===================================================================
---- glibc-2.26.orig/sysdeps/mach/hurd/spawni.c
-+++ glibc-2.26/sysdeps/mach/hurd/spawni.c
-@@ -22,6 +22,7 @@
- #include <spawn.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <stdio.h>
- #include <unistd.h>
- #include <hurd.h>
- #include <hurd/signal.h>
-@@ -44,6 +45,8 @@ __spawni (pid_t *pid, const char *file,
- {
- pid_t new_pid;
- char *path, *p, *name;
-+ char *concat_name = NULL, *relpath, *abspath;
-+ int res;
- size_t len;
- size_t pathlen;
- short int flags;
-@@ -59,14 +62,14 @@ __spawni (pid_t *pid, const char *file,
- that remains visible after an exec is registration with the proc
- server, and the inheritance of various values and ports. All those
- inherited values and ports are what get collected up and passed in the
-- file_exec RPC by an exec call. So we do the proc server registration
-- here, following the model of fork (see fork.c). We then collect up
-- the inherited values and ports from this (parent) process following
-- the model of exec (see hurd/hurdexec.c), modify or replace each value
-- that fork would (plus the specific changes demanded by ATTRP and
-- FILE_ACTIONS), and make the file_exec RPC on the requested executable
-- file with the child process's task port rather than our own. This
-- should be indistinguishable from the fork + exec implementation,
-+ file_exec_paths RPC by an exec call. So we do the proc server
-+ registration here, following the model of fork (see fork.c). We then
-+ collect up the inherited values and ports from this (parent) process
-+ following the model of exec (see hurd/hurdexec.c), modify or replace each
-+ value that fork would (plus the specific changes demanded by ATTRP and
-+ FILE_ACTIONS), and make the file_exec_paths RPC on the requested
-+ executable file with the child process's task port rather than our own.
-+ This should be indistinguishable from the fork + exec implementation,
- except that all errors will be detected here (in the parent process)
- and return proper errno codes rather than the child dying with 127.
-
-@@ -549,7 +552,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. */
-- err = child_lookup (file, O_EXEC, 0, &execfile);
-+ err = child_lookup (relpath = file, O_EXEC, 0, &execfile);
- else
- {
- /* We have to search for FILE on the path. */
-@@ -610,6 +613,7 @@ __spawni (pid_t *pid, const char *file,
- }
-
- // We only get here when we are done looking for the file.
-+ relpath = startp;
- break;
- }
- while (*p++ != '\0');
-@@ -617,6 +621,26 @@ __spawni (pid_t *pid, const char *file,
- if (err)
- goto out;
-
-+ if (relpath[0] == '/')
-+ {
-+ /* Already an absolute path */
-+ abspath = relpath;
-+ }
-+ else
-+ {
-+ /* Relative path */
-+ char *cwd = __getcwd (NULL, 0);
-+ if (cwd == NULL)
-+ goto out;
-+
-+ res = __asprintf (&concat_name, "%s/%s", cwd, relpath);
-+ free (cwd);
-+ if (res == -1)
-+ goto out;
-+
-+ abspath = concat_name;
-+ }
-+
- /* Almost there! */
- {
- mach_port_t ports[_hurd_nports];
-@@ -626,14 +650,28 @@ __spawni (pid_t *pid, const char *file,
-
- inline error_t exec (file_t file)
- {
-- return __file_exec (file, task,
-- (__sigismember (&_hurdsig_traced, SIGKILL)
-- ? EXEC_SIGTRAP : 0),
-- 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);
-+ error_t err = __file_exec_paths
-+ (file, task,
-+ __sigismember (&_hurdsig_traced, SIGKILL) ? EXEC_SIGTRAP : 0,
-+ relpath, abspath, 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)
-+ return __file_exec (file, task,
-+ (__sigismember (&_hurdsig_traced, SIGKILL)
-+ ? EXEC_SIGTRAP : 0),
-+ 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);
-+
-+ return err;
- }
-
- /* Now we are out of things that can fail before the file_exec RPC,
-@@ -752,6 +790,8 @@ __spawni (pid_t *pid, const char *file,
- _hurd_port_free (dtable_cells[i], &ulink_dtable[i], dtable[i]);
- }
-
-+ free (concat_name);
-+
- if (err)
- /* This hack canonicalizes the error code that we return. */
- err = (__hurd_fail (err), errno);
-Index: glibc-2.26/sysdeps/mach/hurd/fexecve.c
-===================================================================
---- glibc-2.26.orig/sysdeps/mach/hurd/fexecve.c
-+++ glibc-2.26/sysdeps/mach/hurd/fexecve.c
-@@ -25,8 +25,9 @@
- int
- fexecve (int fd, char *const argv[], char *const envp[])
- {
-- error_t err = HURD_DPORT_USE (fd, _hurd_exec (__mach_task_self (), port,
-- argv, envp));
-+ error_t err = HURD_DPORT_USE (fd, _hurd_exec_paths (__mach_task_self (),
-+ port, NULL, NULL,
-+ argv, envp));
- if (! err)
- err = EGRATUITOUS;
- return __hurd_fail (err);
diff --git a/debian/patches/hurd-i386/local-exec_filename.diff b/debian/patches/hurd-i386/local-exec_filename.diff
index 1123775..11da37b 100644
--- a/debian/patches/hurd-i386/local-exec_filename.diff
+++ b/debian/patches/hurd-i386/local-exec_filename.diff
@@ -9,7 +9,7 @@ Keep compatibility with experimental implementation
--- a/hurd/Makefile
+++ b/hurd/Makefile
-@@ -32,8 +32,8 @@ user-interfaces := $(addprefix hurd/,\
+@@ -32,8 +32,8 @@
auth auth_request auth_reply startup \
process process_request \
msg msg_reply msg_request \
@@ -22,9 +22,9 @@ Keep compatibility with experimental implementation
)
--- a/hurd/Versions
+++ b/hurd/Versions
-@@ -140,6 +140,14 @@ libc {
- _hurd_sigstate_unlock;
- _hurd_sigstate_delete;
+@@ -124,6 +124,14 @@
+ # functions used in macros & inline functions
+ __errno_location;
}
+ GLIBC_2.21 {
+ # "quasi-internal" functions
@@ -52,7 +52,7 @@ Keep compatibility with experimental implementation
/* 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,
+@@ -39,6 +42,13 @@
return _hurd_exec_paths (task, file, NULL, NULL, argv, envp);
}
@@ -66,7 +66,7 @@ Keep compatibility with experimental implementation
link_warning (_hurd_exec,
"_hurd_exec is deprecated, use _hurd_exec_paths instead");
-@@ -393,6 +403,19 @@ _hurd_exec_paths (task_t task, file_t fi
+@@ -393,6 +403,19 @@
/* Fall back for backwards compatibility. This can just be removed
when __file_exec goes away. */
if (err == MIG_BAD_ID)
@@ -86,7 +86,7 @@ Keep compatibility with experimental implementation
err = __file_exec (file, task, flags,
args, argslen, env, envlen,
dtable, MACH_MSG_TYPE_COPY_SEND, dtablesize,
-@@ -435,3 +458,12 @@ _hurd_exec_paths (task_t task, file_t fi
+@@ -435,3 +458,12 @@
free (env);
return err;
}
@@ -109,7 +109,7 @@ Keep compatibility with experimental implementation
#include <assert.h>
#include <argz.h>
#include "spawn_int.h"
-@@ -657,6 +658,18 @@ __spawni (pid_t *pid, const char *file,
+@@ -657,6 +658,18 @@
dtable, MACH_MSG_TYPE_COPY_SEND, dtablesize,
ports, MACH_MSG_TYPE_COPY_SEND, _hurd_nports,
ints, INIT_INT_MAX,
diff --git a/debian/patches/hurd-i386/local-hurdsig-global-dispositions-version.diff b/debian/patches/hurd-i386/local-hurdsig-global-dispositions-version.diff
index a6ea1bd..219cb2d 100644
--- a/debian/patches/hurd-i386/local-hurdsig-global-dispositions-version.diff
+++ b/debian/patches/hurd-i386/local-hurdsig-global-dispositions-version.diff
@@ -5,16 +5,15 @@ TODO: _DEBIAN_ in versions however pose problem. Remove the _DEBIAN_ version
once packages are rebuilt against 2.21.
---
- hurd/Versions | 8 ++++++++
- 1 files changed, 8 insertions(+)
+ hurd/Versions | 16 ++++++++++++++++
+ hurd/hurdsig.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
+ 2 files changed, 67 insertions(+), 5 deletions(-)
-Index: glibc-2.21/hurd/Versions
-===================================================================
---- glibc-2.21.orig/hurd/Versions
-+++ glibc-2.21/hurd/Versions
-@@ -124,6 +124,22 @@ libc {
- # functions used in macros & inline functions
- __errno_location;
+--- a/hurd/Versions
++++ b/hurd/Versions
+@@ -128,6 +128,22 @@
+ # "quasi-internal" functions
+ _hurd_exec_paths;
}
+ GLIBC_2.13_DEBIAN_19 {
+ # functions used by libpthread and <hurd/signal.h>
@@ -35,10 +34,8 @@ Index: glibc-2.21/hurd/Versions
HURD_CTHREADS_0.3 {
# weak refs to libthreads functions that libc calls iff libthreads in use
-Index: glibc-2.21/hurd/hurdsig.c
-===================================================================
---- glibc-2.21.orig/hurd/hurdsig.c
-+++ glibc-2.21/hurd/hurdsig.c
+--- a/hurd/hurdsig.c
++++ b/hurd/hurdsig.c
@@ -32,6 +32,8 @@
#include "hurdmalloc.h" /* XXX */
#include "../locale/localeinfo.h"
@@ -48,7 +45,7 @@ Index: glibc-2.21/hurd/hurdsig.c
const char *_hurdsig_getenv (const char *);
struct mutex _hurd_siglock;
-@@ -128,7 +130,7 @@ _hurd_thread_sigstate (thread_t thread)
+@@ -128,7 +130,7 @@
* corresponding thread is terminated (the kernel thread port must remain valid
* until this function is called.) */
void
@@ -57,7 +54,7 @@ Index: glibc-2.21/hurd/hurdsig.c
{
struct hurd_sigstate **ssp, *ss;
-@@ -145,14 +147,32 @@ _hurd_sigstate_delete (thread_t thread)
+@@ -145,14 +147,32 @@
if (ss)
free (ss);
}
@@ -91,7 +88,7 @@ Index: glibc-2.21/hurd/hurdsig.c
/* Check whether SS is a global receiver. */
static int
-@@ -164,30 +184,56 @@ sigstate_is_global_rcv (const struct hur
+@@ -164,30 +184,56 @@
/* Lock/unlock a hurd_sigstate structure. If the accessors below require
it, the global sigstate will be locked as well. */
void
diff --git a/debian/patches/hurd-i386/tg-faccessat.diff b/debian/patches/hurd-i386/tg-faccessat.diff
deleted file mode 100644
index 0471732..0000000
--- a/debian/patches/hurd-i386/tg-faccessat.diff
+++ /dev/null
@@ -1,490 +0,0 @@
-From: Samuel Thibault <samuel.thibault@ens-lyon.org>
-Subject: [PATCH] Implement faccessat without AT_EACCESS flag
-
-* hurd/hurd/fd.h: Include <fcntl.h>
-(__hurd_at_flags): New function.
-* hurd/lookup-at.c (__file_name_lookup_at): Replace flag computation
-with call to __hurd_at_flags.
-* include/unistd.h (__faccessat): Add declaration.
-* sysdeps/mach/hurd/access.c (__access): Move implementation to
-__faccessat, and replace it with a call to __faccessat.
-* sysdeps/mach/hurd/euidaccess.c (__euidaccess): Replace implementation
-with a call to __faccessat.
-* sysdeps/mach/hurd/faccessat.c (faccessat): Rename into...
-(__faccessat): ... this. Move implementation of __access into it when
-AT_FLAGS does not contain AT_EACCESS. Make it call __hurd_at_flags, add
-reauthenticate_cwdir_at helper to implement AT mechanism.
-(faccessat): Define weak alias.
-
----
- hurd/hurd/fd.h | 21 +++++
- hurd/lookup-at.c | 13 ---
- include/unistd.h | 1
- sysdeps/mach/hurd/access.c | 156 +++--------------------------------------
- sysdeps/mach/hurd/euidaccess.c | 31 --------
- sysdeps/mach/hurd/faccessat.c | 150 ++++++++++++++++++++++++++++++++++++---
- 6 files changed, 176 insertions(+), 196 deletions(-)
-
---- a/hurd/hurd/fd.h
-+++ b/hurd/hurd/fd.h
-@@ -26,6 +26,7 @@
- #include <hurd/hurd_types.h>
- #include <hurd/port.h>
- #include <sys/socket.h>
-+#include <fcntl.h>
-
-
- /* Structure representing a file descriptor. */
-@@ -254,6 +255,26 @@
- const struct timespec *timeout,
- const sigset_t *sigmask);
-
-+/* Apply AT_FLAGS on FLAGS, in preparation for calling
-+ __hurd_file_name_lookup. */
-+
-+_HURD_FD_H_EXTERN_INLINE error_t
-+__hurd_at_flags (int *at_flags, int *flags)
-+{
-+ if ((*at_flags & AT_SYMLINK_FOLLOW) && (*at_flags & AT_SYMLINK_NOFOLLOW))
-+ return EINVAL;
-+
-+ *flags |= (*at_flags & AT_SYMLINK_NOFOLLOW) ? O_NOLINK : 0;
-+ *at_flags &= ~AT_SYMLINK_NOFOLLOW;
-+ if (*at_flags & AT_SYMLINK_FOLLOW)
-+ *flags &= ~O_NOLINK;
-+ *at_flags &= ~AT_SYMLINK_FOLLOW;
-+ if (*at_flags != 0)
-+ return EINVAL;
-+
-+ return 0;
-+}
-+
- /* Variant of file_name_lookup used in *at function implementations.
- AT_FLAGS may only contain AT_SYMLINK_FOLLOW or AT_SYMLINK_NOFOLLOW,
- which will remove and add O_NOLINK from FLAGS respectively.
---- a/hurd/lookup-at.c
-+++ b/hurd/lookup-at.c
-@@ -29,16 +29,9 @@
- error_t err;
- file_t result;
-
-- if ((at_flags & AT_SYMLINK_FOLLOW) && (at_flags & AT_SYMLINK_NOFOLLOW))
-- return (__hurd_fail (EINVAL), MACH_PORT_NULL);
--
-- flags |= (at_flags & AT_SYMLINK_NOFOLLOW) ? O_NOLINK : 0;
-- at_flags &= ~AT_SYMLINK_NOFOLLOW;
-- if (at_flags & AT_SYMLINK_FOLLOW)
-- flags &= ~O_NOLINK;
-- at_flags &= ~AT_SYMLINK_FOLLOW;
-- if (at_flags != 0)
-- return (__hurd_fail (EINVAL), MACH_PORT_NULL);
-+ err = __hurd_at_flags (&at_flags, &flags);
-+ if (err)
-+ return (__hurd_fail (err), MACH_PORT_NULL);
-
- if (fd == AT_FDCWD || file_name[0] == '/')
- return __file_name_lookup (file_name, flags, mode);
---- a/include/unistd.h
-+++ b/include/unistd.h
-@@ -25,6 +25,7 @@
- /* Now define the internal interfaces. */
- extern int __access (const char *__name, int __type) attribute_hidden;
- extern int __euidaccess (const char *__name, int __type);
-+extern int __faccessat (int __fd, const char *__file, int __type, int __flag);
- extern __off64_t __lseek64 (int __fd, __off64_t __offset, int __whence)
- attribute_hidden;
- extern __off_t __lseek (int __fd, __off_t __offset, int __whence);
---- a/sysdeps/mach/hurd/access.c
-+++ b/sysdeps/mach/hurd/access.c
-@@ -15,159 +15,29 @@
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
-+#include <errno.h>
- #include <unistd.h>
--#include <hurd.h>
--#include <hurd/port.h>
--#include <hurd/id.h>
--#include <hurd/lookup.h>
- #include <fcntl.h>
-
--static int
--hurd_fail_seterrno (error_t err)
--{
-- return __hurd_fail (err);
--}
--
--static int
--hurd_fail_noerrno (error_t err)
-+/* Test for access to FILE by our real user and group IDs. */
-+int
-+__access (const char *file, int type)
- {
-- return -1;
--}
--
--static int
--access_common (const char *file, int type, int (*errfunc) (error_t))
--{
-- error_t err;
-- file_t rcrdir, rcwdir, io;
-- int flags, allowed;
--
-- error_t reauthenticate (int which, file_t *result)
-- {
-- /* Get a port to our root directory, authenticated with the real IDs. */
-- error_t err;
-- mach_port_t ref;
-- ref = __mach_reply_port ();
-- err = HURD_PORT_USE
-- (&_hurd_ports[which],
-- ({
-- err = __io_reauthenticate (port, ref, MACH_MSG_TYPE_MAKE_SEND);
-- if (!err)
-- err = __auth_user_authenticate (_hurd_id.rid_auth,
-- ref, MACH_MSG_TYPE_MAKE_SEND,
-- result);
-- err;
-- }));
-- __mach_port_destroy (__mach_task_self (), ref);
-- return err;
-- }
--
-- error_t init_port (int which, error_t (*operate) (mach_port_t))
-- {
-- switch (which)
-- {
-- case INIT_PORT_AUTH:
-- return (*operate) (_hurd_id.rid_auth);
-- case INIT_PORT_CRDIR:
-- return (reauthenticate (INIT_PORT_CRDIR, &rcrdir) ?:
-- (*operate) (rcrdir));
-- case INIT_PORT_CWDIR:
-- return (reauthenticate (INIT_PORT_CWDIR, &rcwdir) ?:
-- (*operate) (rcwdir));
-- default:
-- return _hurd_ports_use (which, operate);
-- }
-- }
--
-- rcrdir = rcwdir = MACH_PORT_NULL;
--
-- HURD_CRITICAL_BEGIN;
--
-- __mutex_lock (&_hurd_id.lock);
-- /* Get _hurd_id up to date. */
-- if (err = _hurd_check_ids ())
-- goto lose;
--
-- if (_hurd_id.rid_auth == MACH_PORT_NULL)
-- {
-- /* Set up _hurd_id.rid_auth. This is a special auth server port
-- which uses the real uid and gid (the first aux uid and gid) as
-- the only effective uid and gid. */
--
-- if (_hurd_id.aux.nuids < 1 || _hurd_id.aux.ngids < 1)
-- {
-- /* We do not have a real UID and GID. Lose, lose, lose! */
-- err = EGRATUITOUS;
-- goto lose;
-- }
--
-- /* Create a new auth port using our real UID and GID (the first
-- auxiliary UID and GID) as the only effective IDs. */
-- if (err = __USEPORT (AUTH,
-- __auth_makeauth (port,
-- NULL, MACH_MSG_TYPE_COPY_SEND, 0,
-- _hurd_id.aux.uids, 1,
-- _hurd_id.aux.uids,
-- _hurd_id.aux.nuids,
-- _hurd_id.aux.gids, 1,
-- _hurd_id.aux.gids,
-- _hurd_id.aux.ngids,
-- &_hurd_id.rid_auth)))
-- goto lose;
-- }
--
-- if (!err)
-- /* Look up the file name using the modified init ports. */
-- err = __hurd_file_name_lookup (&init_port, &__getdport, 0,
-- file, 0, 0, &io);
--
-- /* We are done with _hurd_id.rid_auth now. */
-- lose:
-- __mutex_unlock (&_hurd_id.lock);
--
-- HURD_CRITICAL_END;
--
-- if (rcrdir != MACH_PORT_NULL)
-- __mach_port_deallocate (__mach_task_self (), rcrdir);
-- if (rcwdir != MACH_PORT_NULL)
-- __mach_port_deallocate (__mach_task_self (), rcwdir);
-- if (err)
-- return errfunc (err);
--
-- /* Find out what types of access we are allowed to this file. */
-- err = __file_check_access (io, &allowed);
-- __mach_port_deallocate (__mach_task_self (), io);
-- if (err)
-- return errfunc (err);
--
-- flags = 0;
-- if (type & R_OK)
-- flags |= O_READ;
-- if (type & W_OK)
-- flags |= O_WRITE;
-- if (type & X_OK)
-- flags |= O_EXEC;
--
-- if (flags & ~allowed)
-- /* We are not allowed all the requested types of access. */
-- return errfunc (EACCES);
--
-- return 0;
-+ return __faccessat (AT_FDCWD, file, type, 0);
- }
-
- /* Test for access to FILE by our real user and group IDs without setting
-- errno. This may be unsafe to run during initialization of tunables
-- since access_common calls __hurd_file_name_lookup, which calls
-- __hurd_file_name_lookup_retry, which can set errno. */
-+ errno. */
- int
- __access_noerrno (const char *file, int type)
- {
-- return access_common (file, type, hurd_fail_noerrno);
--}
-+ int ret;
-+ int saved_errno = errno;
-
--/* Test for access to FILE by our real user and group IDs. */
--int
--__access (const char *file, int type)
--{
-- return access_common (file, type, hurd_fail_seterrno);
-+ ret = __faccessat (AT_FDCWD, file, type, 0);
-+
-+ __set_errno(saved_errno);
-+ return ret;
- }
-+
- weak_alias (__access, access)
---- a/sysdeps/mach/hurd/euidaccess.c
-+++ b/sysdeps/mach/hurd/euidaccess.c
-@@ -16,42 +16,13 @@
- License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
-
--#include <errno.h>
--#include <stddef.h>
- #include <unistd.h>
- #include <fcntl.h>
--#include <hurd.h>
-
- int
- __euidaccess (const char *file, int type)
- {
-- error_t err;
-- file_t port;
-- int allowed, flags;
--
-- port = __file_name_lookup (file, 0, 0);
-- if (port == MACH_PORT_NULL)
-- return -1;
--
-- /* Find out what types of access we are allowed to this file. */
-- err = __file_check_access (port, &allowed);
-- __mach_port_deallocate (__mach_task_self (), port);
-- if (err)
-- return __hurd_fail (err);
--
-- flags = 0;
-- if (type & R_OK)
-- flags |= O_READ;
-- if (type & W_OK)
-- flags |= O_WRITE;
-- if (type & X_OK)
-- flags |= O_EXEC;
--
-- if (flags & ~allowed)
-- /* We are not allowed all the requested types of access. */
-- return __hurd_fail (EACCES);
--
-- return 0;
-+ return __faccessat (AT_FDCWD, file, type, AT_EACCESS);
- }
- weak_alias (__euidaccess, euidaccess)
- weak_alias (__euidaccess, eaccess)
---- a/sysdeps/mach/hurd/faccessat.c
-+++ b/sysdeps/mach/hurd/faccessat.c
-@@ -23,29 +23,152 @@
- #include <sys/types.h>
- #include <hurd.h>
- #include <hurd/fd.h>
-+#include <hurd/port.h>
-+#include <hurd/id.h>
-+#include <hurd/lookup.h>
-
- int
--faccessat (int fd, const char *file, int type, int flag)
-+__faccessat (int fd, const char *file, int type, int at_flags)
- {
- error_t err;
-- file_t port;
-- int allowed, flags;
-+ file_t rcrdir, rcwdir, io;
-+ int flags, allowed;
-
-- if ((flag & AT_EACCESS) == 0)
-+ if ((at_flags & AT_EACCESS) == AT_EACCESS)
- {
-- if (fd == AT_FDCWD || file[0] == '/')
-- return __access (file, type);
-- __set_errno (ENOTSUP); /* XXX later */
-- return -1;
-+ /* Use effective permissions. */
-+ io = __file_name_lookup_at (fd, at_flags &~ AT_EACCESS, file, 0, 0);
-+ if (io == MACH_PORT_NULL)
-+ return -1;
- }
-+ else
-+ {
-+ /* We have to use real permissions instead of the
-+ usual effective permissions. */
-+
-+ int hurd_flags = 0;
-+ __hurd_at_flags (&at_flags, &hurd_flags);
-
-- port = __file_name_lookup_at (fd, flag &~ AT_EACCESS, file, 0, 0);
-- if (port == MACH_PORT_NULL)
-- return -1;
-+ error_t reauthenticate_cwdir_at (file_t *result)
-+ {
-+ /* Get a port to the FD directory, authenticated with the real IDs. */
-+ error_t err;
-+ mach_port_t ref;
-+ ref = __mach_reply_port ();
-+ err = HURD_DPORT_USE
-+ (fd,
-+ ({
-+ err = __io_reauthenticate (port, ref, MACH_MSG_TYPE_MAKE_SEND);
-+ if (!err)
-+ err = __auth_user_authenticate (_hurd_id.rid_auth,
-+ ref, MACH_MSG_TYPE_MAKE_SEND,
-+ result);
-+ err;
-+ }));
-+ __mach_port_destroy (__mach_task_self (), ref);
-+ return err;
-+ }
-+
-+ error_t reauthenticate (int which, file_t *result)
-+ {
-+ /* Get a port to our root directory, authenticated with the real IDs. */
-+ error_t err;
-+ mach_port_t ref;
-+ ref = __mach_reply_port ();
-+ err = HURD_PORT_USE
-+ (&_hurd_ports[which],
-+ ({
-+ err = __io_reauthenticate (port, ref, MACH_MSG_TYPE_MAKE_SEND);
-+ if (!err)
-+ err = __auth_user_authenticate (_hurd_id.rid_auth,
-+ ref, MACH_MSG_TYPE_MAKE_SEND,
-+ result);
-+ err;
-+ }));
-+ __mach_port_destroy (__mach_task_self (), ref);
-+ return err;
-+ }
-+
-+ error_t init_port (int which, error_t (*operate) (mach_port_t))
-+ {
-+ switch (which)
-+ {
-+ case INIT_PORT_AUTH:
-+ return (*operate) (_hurd_id.rid_auth);
-+ case INIT_PORT_CRDIR:
-+ return (reauthenticate (INIT_PORT_CRDIR, &rcrdir) ?:
-+ (*operate) (rcrdir));
-+ case INIT_PORT_CWDIR:
-+ if (fd == AT_FDCWD || file[0] == '/')
-+ return (reauthenticate (INIT_PORT_CWDIR, &rcwdir) ?:
-+ (*operate) (rcwdir));
-+ else
-+ return (reauthenticate_cwdir_at (&rcwdir) ?:
-+ (*operate) (rcwdir));
-+ default:
-+ return _hurd_ports_use (which, operate);
-+ }
-+ }
-+
-+ rcrdir = rcwdir = MACH_PORT_NULL;
-+
-+ HURD_CRITICAL_BEGIN;
-+
-+ __mutex_lock (&_hurd_id.lock);
-+ /* Get _hurd_id up to date. */
-+ if (err = _hurd_check_ids ())
-+ goto lose;
-+
-+ if (_hurd_id.rid_auth == MACH_PORT_NULL)
-+ {
-+ /* Set up _hurd_id.rid_auth. This is a special auth server port
-+ which uses the real uid and gid (the first aux uid and gid) as
-+ the only effective uid and gid. */
-+
-+ if (_hurd_id.aux.nuids < 1 || _hurd_id.aux.ngids < 1)
-+ {
-+ /* We do not have a real UID and GID. Lose, lose, lose! */
-+ err = EGRATUITOUS;
-+ goto lose;
-+ }
-+
-+ /* Create a new auth port using our real UID and GID (the first
-+ auxiliary UID and GID) as the only effective IDs. */
-+ if (err = __USEPORT (AUTH,
-+ __auth_makeauth (port,
-+ NULL, MACH_MSG_TYPE_COPY_SEND, 0,
-+ _hurd_id.aux.uids, 1,
-+ _hurd_id.aux.uids,
-+ _hurd_id.aux.nuids,
-+ _hurd_id.aux.gids, 1,
-+ _hurd_id.aux.gids,
-+ _hurd_id.aux.ngids,
-+ &_hurd_id.rid_auth)))
-+ goto lose;
-+ }
-+
-+ if (!err)
-+ /* Look up the file name using the modified init ports. */
-+ err = __hurd_file_name_lookup (&init_port, &__getdport, 0,
-+ file, hurd_flags, 0, &io);
-+
-+ /* We are done with _hurd_id.rid_auth now. */
-+ lose:
-+ __mutex_unlock (&_hurd_id.lock);
-+
-+ HURD_CRITICAL_END;
-+
-+ if (rcrdir != MACH_PORT_NULL)
-+ __mach_port_deallocate (__mach_task_self (), rcrdir);
-+ if (rcwdir != MACH_PORT_NULL)
-+ __mach_port_deallocate (__mach_task_self (), rcwdir);
-+ if (err)
-+ return __hurd_fail (err);
-+ }
-
- /* Find out what types of access we are allowed to this file. */
-- err = __file_check_access (port, &allowed);
-- __mach_port_deallocate (__mach_task_self (), port);
-+ err = __file_check_access (io, &allowed);
-+ __mach_port_deallocate (__mach_task_self (), io);
- if (err)
- return __hurd_fail (err);
-
-@@ -63,3 +186,4 @@
-
- return 0;
- }
-+weak_alias (__faccessat, faccessat)
diff --git a/debian/patches/series b/debian/patches/series
index 4291fc8..53ab02f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -67,7 +67,6 @@ hurd-i386/cvs-libpthread.diff
hurd-i386/libpthread_build.diff
hurd-i386/tg-libpthread_depends.diff
hurd-i386/libpthread_version.diff
-hurd-i386/git-exec_filename.diff
hurd-i386/unsubmitted-gnumach.defs.diff
hurd-i386/tg-hurdsig-boot-fix.diff
hurd-i386/tg-single-select-timeout.diff
@@ -101,7 +100,6 @@ hurd-i386/local-mach_print.diff
hurd-i386/submitted-hurd-abilist.diff
hurd-i386/local-versions.diff
#hurd-i386/submitted-anon-mmap-shared.diff
-hurd-i386/tg-faccessat.diff
hurd-i386/tg-extern_inline.diff
hurd-i386/tg-eintr.diff
hurd-i386/tg-gsync-libc.diff
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-glibc/glibc.git
Reply to: