access X_OK for administrators has changed in cygwin 3.5.5
Bruno Haible
bruno@clisp.org
Wed Dec 25 00:29:47 GMT 2024
Hi,
The behaviour of the access(_, X_OK) call has changed for administrator
users in Cygwin 3.5.5. I don't know whether that's intended or not
(haven't seen it mentioned in
<https://sourceware.org/pipermail/cygwin-announce/2024-December/012023.html>).
How to reproduce:
========================== foo.c ===========================
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <grp.h>
#include <unistd.h>
int main ()
{
close (creat ("file", 0600));
chmod ("file", 0400);
printf ("file X_OK ? %d\n", access ("file", X_OK));
}
============================================================
1. In a normal Cygwin console (mintty):
$ rm -f file
$ gcc -Wall foo.c
$ ./a
=> file X_OK ? -1
2. In a Cygwin console that runs "as administrator":
$ ./a
=> In Cygwin 3.4.6: file X_OK ? -1
In Cygwin 3.5.5: file X_OK ? 0
Bruno
More information about the Cygwin
mailing list