* fhandler.cc (fhandler_disk_file::open): Check for buggy CreateFile
condition. * path.cc (path_conv::check): Get file system type in call to GetVolumeInformation to check for file systems with buggy CreateFile. * path.h (enum path_types): Add PATH_HASBUGGYOPEN. (class path_conv): Add methods `has_buggy_open' and `set_has_buggy_open'.
This commit is contained in:
@ -1238,6 +1238,21 @@ fhandler_disk_file::open (path_conv& real_path, int flags, mode_t mode)
|
||||
if (!res)
|
||||
goto out;
|
||||
|
||||
/* This is for file systems known for having a buggy CreateFile call
|
||||
which might return a valid HANDLE without having actually opened
|
||||
the file.
|
||||
The only known file system to date is the SUN NFS Solstice Client 3.1
|
||||
which returns a valid handle when trying to open a file in a non
|
||||
existant directory. */
|
||||
if (real_path.has_buggy_open ()
|
||||
&& GetFileAttributes (win32_path_name_) == (DWORD) -1)
|
||||
{
|
||||
debug_printf ("Buggy open detected.");
|
||||
close ();
|
||||
set_errno (ENOENT);
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern BOOL allow_ntea;
|
||||
extern BOOL allow_ntsec;
|
||||
|
||||
|
Reference in New Issue
Block a user