4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-13 04:29:09 +08:00
Corinna Vinschen 5f7ed4659b Cygwin: access: Fix X_OK behaviour for backup operators and admins
After commit a0933cd17d19, access(_, X_OK) returns 0 if the user
holds SE_BACKUP_PRIVILEGE, even if the file's ACL denies execution
to the user.  This is triggered by trying to open the file with
FILE_OPEN_FOR_BACKUP_INTENT.

Fix check_file_access() so it checks for X_OK without specifying
the FILE_OPEN_FOR_BACKUP_INTENT flag if the file is not a directory.

Rearrange function slightly and add comments for easier comprehension.

Fixes: a0933cd17d19 ("Cygwin: access: Correction for samba/SMB share")
Reported-by: Bruno Haible <bruno@clisp.org>
Co-authored-by: Takashi Yano <takashi.yano@nifty.ne.jp>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
(cherry picked from commit 2e4db338ac125579d555aeee516e48588a628a16)
2025-01-08 16:13:51 +01:00
..
2024-12-20 16:39:35 +01:00
2022-08-04 20:54:09 +02:00
2022-08-04 22:13:59 +02:00
2023-02-25 16:12:51 +01:00
2022-08-04 22:13:59 +02:00
2024-01-15 12:52:56 +01:00
2024-01-23 09:49:02 +01:00
2023-11-05 17:01:43 +01:00
2022-08-04 15:16:48 +02:00
2022-05-29 17:45:52 -04:00
2022-08-04 22:13:59 +02:00
2022-05-29 17:45:52 -04:00
2022-08-04 22:13:59 +02:00
2022-05-29 17:45:52 -04:00
2022-08-04 22:13:59 +02:00
2022-08-04 22:13:59 +02:00
2024-09-12 10:57:24 -04:00
2022-08-04 22:13:59 +02:00