From 05e0dcc329da6b1c8a0be52cf9ec5ce6c64960ae Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 23 May 2024 17:36:05 +0200 Subject: [PATCH] access, euidaccess tests: Avoid test failures on Cygwin. * tests/test-access.h (test_access): On Cygwin, don't test for the absence of the W_OK permission. --- ChangeLog | 6 ++++++ tests/test-access.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3c0f409f57..1ebd9c30e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2024-05-23 Bruno Haible + + access, euidaccess tests: Avoid test failures on Cygwin. + * tests/test-access.h (test_access): On Cygwin, don't test for the + absence of the W_OK permission. + 2024-05-23 Bruno Haible c32is*, c32toupper tests: Avoid test failures on Cygwin. diff --git a/tests/test-access.h b/tests/test-access.h index 0f9a45fc65..ece89beb6b 100644 --- a/tests/test-access.h +++ b/tests/test-access.h @@ -77,12 +77,16 @@ test_access (int (*func) (const char * /*file*/, int /*mode*/)) ASSERT (func (BASE "f2", R_OK) == 0); + /* On Cygwin, for users that are in the 'Administrators' group, + W_OK is allowed. */ +#if !defined __CYGWIN__ if (geteuid () != ROOT_UID) { errno = 0; ASSERT (func (BASE "f2", W_OK) == -1); ASSERT (errno == EACCES); } +#endif #if defined _WIN32 && !defined __CYGWIN__ /* X_OK works like R_OK. */ -- 2.39.5