diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2009-01-29 20:32:08 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2009-01-29 20:32:08 +0000 |
commit | 43616e5526861e4e6afeafb2f9cf4d4626a237b6 (patch) | |
tree | 4578bfc345ff5b9720e1b40d675bee292e6b18f1 /winsup/cygwin/path.cc | |
parent | bacd5877baf38e412c61b47f9ea24a24e01814e8 (diff) | |
download | cygnal-43616e5526861e4e6afeafb2f9cf4d4626a237b6.tar.gz cygnal-43616e5526861e4e6afeafb2f9cf4d4626a237b6.tar.bz2 cygnal-43616e5526861e4e6afeafb2f9cf4d4626a237b6.zip |
* 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
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r-- | winsup/cygwin/path.cc | 28 |
1 files changed, 27 insertions, 1 deletions
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; |