From 43616e5526861e4e6afeafb2f9cf4d4626a237b6 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 29 Jan 2009 20:32:08 +0000 Subject: * fhandler_disk_file.cc (fhandler_disk_file::readdir): Fix inode number evaluation for faked "." entry. * mount.cc (fs_info::update): Move setting of is_cdrom after checking for caseinsensitivity. Recognize UDF in is_cdrom case and set caseinsensitive flag according to UDF brokenness determined by OS. Add comment to explain why. * mount.h (class fs_info): Add is_udf status flag. * path.cc (symlink_info::check): Add workaround for UDF bug in terms of casesensitivity on certain OSes. * wincap.h (wincaps::has_broken_udf): New element. (wincaps::has_broken_udf): New element --- winsup/cygwin/path.cc | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/path.cc') diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index aa635103d..ae01109a1 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -2140,6 +2140,7 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt, NTSTATUS status; IO_STATUS_BLOCK io; bool no_ea = false; + bool fs_update_called = false; error = 0; get_nt_native_path (suffix.path, upath); @@ -2179,6 +2180,30 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt, FILE_OPEN_REPARSE_POINT | FILE_OPEN_FOR_BACKUP_INTENT); } + if (status == STATUS_OBJECT_NAME_NOT_FOUND && ci_flag == 0 + && wincap.has_broken_udf ()) + { + /* On NT 5.x UDF is broken (at least) in terms of case sensitivity. + When trying to open a file case sensitive, the file appears to be + non-existant. Another bug is described in fs_info::update. */ + attr.Attributes = OBJ_CASE_INSENSITIVE; + status = NtOpenFile (&h, READ_CONTROL | FILE_READ_ATTRIBUTES, + &attr, &io, FILE_SHARE_VALID_FLAGS, + FILE_OPEN_REPARSE_POINT + | FILE_OPEN_FOR_BACKUP_INTENT); + attr.Attributes = ci_flag; + if (NT_SUCCESS (status)) + { + fs.update (&upath, h); + if (fs.is_udf ()) + fs_update_called = true; + else + { + NtClose (h); + status = STATUS_OBJECT_NAME_NOT_FOUND; + } + } + } if (NT_SUCCESS (status) && NT_SUCCESS (status = NtQueryInformationFile (h, &io, &fbi, sizeof fbi, @@ -2271,7 +2296,8 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt, /* Check file system while we're having the file open anyway. This speeds up path_conv noticably (~10%). */ - fs.update (&upath, h); + if (!fs_update_called) + fs.update (&upath, h); ext_tacked_on = !!*ext_here; -- cgit v1.2.3