components/bash/patches/solaris-023.eaccess.c.patch
author Stefan Teleman <stefan.teleman@oracle.com>
Fri, 27 Feb 2015 09:41:59 -0800
changeset 3871 ddf9e355ac16
child 5518 c47fe0edc204
permissions -rw-r--r--
15646021 problem in UTILITY/BASH 20597159 bash builtin test returns wrong result for executable test

# 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 @@
   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