From 09085ede12fb9650f286bdcd805609ae69f80618 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 10 Jan 2018 01:58:23 +0100 Subject: hurd: Implement faccessat without AT_EACCESS flag * hurd/hurd/fd.h: Include (__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, __faccessat_noerrno): Add declaration. * sysdeps/mach/hurd/access.c (access_common): Move implementation to __faccessat (hurd_fail_seterrno, hurd_fail_noerrno): Move to sysdeps/mach/hurd/faccessat.c. (__access_noerrno): Use __faccessat_common instead of access_common. (__access): Likewise. * sysdeps/mach/hurd/euidaccess.c (__euidaccess): Replace implementation with a call to __faccessat. * sysdeps/mach/hurd/faccessat.c (faccessat): Rename into... (__faccessat_common): ... 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_noerrno): New function, just calls __faccessat_common. (__faccessat): New function, just calls __faccessat_common. (faccessat): Define weak alias. --- include/unistd.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/unistd.h b/include/unistd.h index f884fda..0f91b8b 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -25,6 +25,9 @@ libc_hidden_proto (readlinkat) /* 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 int __faccessat_noerrno (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); -- cgit v1.1