components/bash/patches/solaris-023.eaccess.c.patch
changeset 5518 c47fe0edc204
parent 3871 ddf9e355ac16
child 7486 57b5a32e1ae4
--- a/components/bash/patches/solaris-023.eaccess.c.patch	Mon Feb 29 17:20:30 2016 +0000
+++ b/components/bash/patches/solaris-023.eaccess.c.patch	Mon Feb 29 10:09:14 2016 -0800
@@ -1,18 +1,16 @@
-# Internal patch.
-# Do not return true if euid == 0 and file does not have the execute bit set.
---- lib/sh/eaccess.c	2015-02-26 13:35:43.607917337 -0800
-+++ lib/sh/eaccess.c	2015-02-26 13:36:29.154827001 -0800
-@@ -211,11 +211,11 @@
+# Solaris-specific. The famous access(2) bug that will return
+# X_OK even if the execute bit isn't set.
+# So, we want to use stat(2) instead, which returns the actual
+# permission bits.
+--- lib/sh/eaccess.c	2015-04-02 10:24:43.401129429 -0700
++++ lib/sh/eaccess.c	2015-04-02 10:28:57.704781076 -0700
+@@ -211,7 +211,8 @@
    if (path_is_devfd (path))
      return (sh_stataccess (path, mode));
  
--#if defined (HAVE_FACCESSAT) && defined (AT_EACCESS)
-+#if defined(HAVE_FACCESSAT) && defined(AT_EACCESS) && !defined(SOLARIS)
-   return (faccessat (AT_FDCWD, path, mode, AT_EACCESS));
- #elif defined (HAVE_EACCESS)		/* FreeBSD */
-   ret = eaccess (path, mode);	/* XXX -- not always correct for X_OK */
--#  if defined (__FreeBSD__)
-+#  if defined(__FreeBSD__) || defined(SOLARIS)
-   if (ret == 0 && current_user.euid == 0 && mode == X_OK)
-     return (sh_stataccess (path, mode));
- #  endif
+-#if (defined (HAVE_FACCESSAT) && defined (AT_EACCESS)) || defined (HAVE_EACCESS)
++#if ((defined (HAVE_FACCESSAT) && defined (AT_EACCESS)) || \
++    defined (HAVE_EACCESS)) && !defined(SOLARIS)
+ #  if defined (HAVE_FACCESSAT) && defined (AT_EACCESS)
+   ret = faccessat (AT_FDCWD, path, mode, AT_EACCESS);
+ #  else		/* HAVE_EACCESS */	/* FreeBSD */