+2024-05-21 Bruno Haible <bruno@clisp.org>
+
+ access, euidaccess tests: Avoid test failure for root user on Solaris.
+ * tests/test-access.h (test_access): On Solaris, for the root user,
+ don't expect X_OK permissions to be absent.
+ * doc/posix-functions/access.texi: Mention the Solaris problem.
+ * doc/glibc-functions/euidaccess.texi: Likewise.
+
2024-05-21 Collin Funk <collin.funk1@gmail.com>
fnmatch tests: Avoid test failure on OmniOS.
This function does not have an option for not following symbolic links
(like @code{stat} versus @code{lstat}). If you need this option, use
the Gnulib module @code{faccessat} with the @code{AT_EACCESS} flag.
+@item
+On Solaris, for the root user, any file is @code{X_OK} even if the file
+does not have the @code{x} permission bit set.
@end itemize
(like @code{stat} versus @code{lstat}). If you need this option, use
the Gnulib module @code{faccessat} with the @code{AT_EACCESS} flag.
@item
+On Solaris, for the root user, any file is @code{X_OK} even if the file
+does not have the @code{x} permission bit set.
+@item
On native Windows, files whose basename does not contain a @samp{.}
cannot be executed through @code{execlp} or @code{execvp}. Nevertheless,
this function may return true for such files.
/* X_OK works like R_OK. */
ASSERT (func (BASE "f2", X_OK) == 0);
#else
- errno = 0;
- ASSERT (func (BASE "f2", X_OK) == -1);
- ASSERT (errno == EACCES);
+ /* On Solaris, for the root user, X_OK is allowed. */
+# if defined __sun
+ if (geteuid () != ROOT_UID)
+# endif
+ {
+ errno = 0;
+ ASSERT (func (BASE "f2", X_OK) == -1);
+ ASSERT (errno == EACCES);
+ }
#endif
}