diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2024-04-04 17:36:01 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2024-04-04 18:22:19 +0200 |
commit | e00cb126944e4d4e4b5ca4a2710a52ef6503462b (patch) | |
tree | 5d2668fe032f650121f6790e9a21b2816e2fe4a7 | |
parent | b896891b03c3ce9d385ca2343c0b526b5d7972a9 (diff) | |
download | newlib-e00cb126944e4d4e4b5ca4a2710a52ef6503462b.zip newlib-e00cb126944e4d4e4b5ca4a2710a52ef6503462b.tar.gz newlib-e00cb126944e4d4e4b5ca4a2710a52ef6503462b.tar.bz2 |
Cygwin: FILE_OPEN_NO_RECALL is incompatible with FILE_DIRECTORY_FILE
If FILE_DIRECTORY_FILE is given, FILE_OPEN_NO_RECALL is not allowed,
otherwise NtCreateFile returns STATUS_INVALID_PARAMETER.
Drop FILE_OPEN_NO_RECALL where FILE_DIRECTORY_FILE is specified.
Fixes: f6b56abec186 ("Cygwin: try to avoid recalling offline files")
Reported-by: Bruce Jerrick <bmj001@gmail.com>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r-- | winsup/cygwin/fhandler/disk_file.cc | 1 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/release/3.5.4 | 6 |
3 files changed, 6 insertions, 3 deletions
diff --git a/winsup/cygwin/fhandler/disk_file.cc b/winsup/cygwin/fhandler/disk_file.cc index f359214..2cfac6b 100644 --- a/winsup/cygwin/fhandler/disk_file.cc +++ b/winsup/cygwin/fhandler/disk_file.cc @@ -330,7 +330,6 @@ fhandler_base::fstat_by_name (struct stat *buf) status = NtOpenFile (&dir, SYNCHRONIZE | FILE_LIST_DIRECTORY, &attr, &io, FILE_SHARE_VALID_FLAGS, FILE_SYNCHRONOUS_IO_NONALERT - | FILE_OPEN_NO_RECALL | FILE_OPEN_FOR_BACKUP_INTENT | FILE_DIRECTORY_FILE); if (!NT_SUCCESS (status)) diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index c0d62e5..1802e76 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -576,7 +576,6 @@ getfileattr (const char *path, bool caseinsensitive) /* path has to be always ab status = NtOpenFile (&dir, SYNCHRONIZE | FILE_LIST_DIRECTORY, &attr, &io, FILE_SHARE_VALID_FLAGS, FILE_SYNCHRONOUS_IO_NONALERT - | FILE_OPEN_NO_RECALL | FILE_OPEN_FOR_BACKUP_INTENT | FILE_DIRECTORY_FILE); if (NT_SUCCESS (status)) @@ -3321,7 +3320,6 @@ restart: status = NtOpenFile (&dir, SYNCHRONIZE | FILE_LIST_DIRECTORY, &dattr, &io, FILE_SHARE_VALID_FLAGS, FILE_SYNCHRONOUS_IO_NONALERT - | FILE_OPEN_NO_RECALL | FILE_OPEN_FOR_BACKUP_INTENT | FILE_DIRECTORY_FILE); if (!NT_SUCCESS (status)) diff --git a/winsup/cygwin/release/3.5.4 b/winsup/cygwin/release/3.5.4 new file mode 100644 index 0000000..e2bd025 --- /dev/null +++ b/winsup/cygwin/release/3.5.4 @@ -0,0 +1,6 @@ +Fixes: +------ + +- Fix regression in 3.5.3 which fails to open files for stat(2) if the + file is opened exclusively by another process. + Addresses: https://cygwin.com/pipermail/cygwin/2024-April/255811.html |