This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.24-389-ge92bd6e


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  e92bd6e362470aa0a79cfb19a512944f0761184b (commit)
      from  c73c7fc07c001f2a907a9c6d50c57d377ce0351f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e92bd6e362470aa0a79cfb19a512944f0761184b

commit e92bd6e362470aa0a79cfb19a512944f0761184b
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Fri Nov 18 16:41:00 2016 -0200

    Fix hurd __access_noerrno implementation.
    
    This patch fixes some hurd bits from commit afcf3cd8eb that added the
    __access_noerrno internal symbol.  It basically removes the nonrequired
    __hurd_fail_noerrno (since the 'err' argument is ignored) and fixes
    a typo for EACCES.
    
    However, as stated on maillist [1] this __access_noerrno may still be
    unsafe to run during initialization of tunables on the Hurd.  The
    access_common calls __hurd_file_name_lookup, which calls
    __hurd_file_name_lookup_retry, which can set errno.
    
    [1] https://sourceware.org/ml/libc-alpha/2016-11/msg00646.html

diff --git a/ChangeLog b/ChangeLog
index 4c90aa0..b923ac9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-11-18  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+	* hurd/hurd.h (__hurd_fail_noerrno): Remove function.
+	* include/unistd.h: Extend comment about __access_noerrno return
+	semantics.
+	* sysdeps/match/hurd/access.c (__hurd_fail_noerrno): Return -1.
+	(access_common): Correct typo for EACCES.
+
 2016-11-18  Chris Metcalf  <cmetcalf@mellanox.com>
 
 	* sysdeps/tile/math-tests.h: New file.
diff --git a/hurd/hurd.h b/hurd/hurd.h
index c089d4c..ec07827 100644
--- a/hurd/hurd.h
+++ b/hurd/hurd.h
@@ -75,35 +75,6 @@ __hurd_fail (error_t err)
   errno = err;
   return -1;
 }
-
-_HURD_H_EXTERN_INLINE int
-__hurd_fail_noerrno (error_t err)
-{
-  switch (err)
-    {
-    case EMACH_SEND_INVALID_DEST:
-    case EMIG_SERVER_DIED:
-      /* The server has disappeared!  */
-      err = EIEIO;
-      break;
-
-    case KERN_NO_SPACE:
-      err = ENOMEM;
-      break;
-
-    case KERN_INVALID_ARGUMENT:
-      err = EINVAL;
-      break;
-
-    case 0:
-      return 0;
-
-    default:
-      break;
-    }
-
-  return -1;
-}
 
 /* Basic ports and info, initialized by startup.  */
 
diff --git a/include/unistd.h b/include/unistd.h
index 6144f41..16d68a1 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -183,7 +183,8 @@ extern int __getlogin_r_loginuid (char *name, size_t namesize)
 
 #  if IS_IN (rtld) || !defined SHARED
 /* __access variant that does not set errno.  Used in very early initialization
-   code in libc.a and ld.so.  */
+   code in libc.a and ld.so.  It follows access return semantics (zero for
+   sucess otherwise a value different than 0).  */
 extern __typeof (__access) __access_noerrno attribute_hidden;
 #  endif
 
diff --git a/sysdeps/mach/hurd/access.c b/sysdeps/mach/hurd/access.c
index 93e2166..0df939a 100644
--- a/sysdeps/mach/hurd/access.c
+++ b/sysdeps/mach/hurd/access.c
@@ -31,7 +31,7 @@ hurd_fail_seterrno (error_t err)
 static int
 hurd_fail_noerrno (error_t err)
 {
-  return __hurd_fail_noerrno (err);
+  return -1;
 }
 
 static int
@@ -149,13 +149,15 @@ access_common (const char *file, int type, int (*errfunc) (error_t))
 
   if (flags & ~allowed)
     /* We are not allowed all the requested types of access.  */
-    return errfunc (EACESS);
+    return errfunc (EACCES);
 
   return 0;
 }
 
 /* Test for access to FILE by our real user and group IDs without setting
-   errno.  */
+   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.  */
 int
 __access_noerrno (const char *file, int type)
 {

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                  |    8 ++++++++
 hurd/hurd.h                |   29 -----------------------------
 include/unistd.h           |    3 ++-
 sysdeps/mach/hurd/access.c |    8 +++++---
 4 files changed, 15 insertions(+), 33 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]