* path.cc (symlink_info::check): Don't use FileNetworkOpenInformation

on Netapps.  Relax condition for workaround.  Always request size
	information via FileStandardInformation info class in workaround.
This commit is contained in:
Corinna Vinschen 2010-11-23 09:26:16 +00:00
parent 8b6fbbba10
commit 5fe7c5e01b
2 changed files with 29 additions and 10 deletions

View File

@ -1,3 +1,9 @@
2010-11-23 Corinna Vinschen <corinna@vinschen.de>
* path.cc (symlink_info::check): Don't use FileNetworkOpenInformation
on Netapps. Relax condition for workaround. Always request size
information via FileStandardInformation info class in workaround.
2010-11-22 Corinna Vinschen <corinna@vinschen.de> 2010-11-22 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (NETAPP_IGNORE): Add FILE_PERSISTENT_ACLS. * mount.cc (NETAPP_IGNORE): Add FILE_PERSISTENT_ACLS.

View File

@ -2388,24 +2388,37 @@ restart:
{ {
PFILE_NETWORK_OPEN_INFORMATION pfnoi = conv_hdl.fnoi (); PFILE_NETWORK_OPEN_INFORMATION pfnoi = conv_hdl.fnoi ();
status = NtQueryInformationFile (h, &io, pfnoi, sizeof *pfnoi, /* Netapps don't implement FileNetworkOpenInformation. */
FileNetworkOpenInformation); status = fs.is_netapp ()
if ((status == STATUS_INVALID_PARAMETER ? STATUS_INVALID_PARAMETER
|| status == STATUS_NOT_IMPLEMENTED) : NtQueryInformationFile (h, &io, pfnoi, sizeof *pfnoi,
&& RtlEqualUnicodePathPrefix (&upath, &ro_u_uncp, FALSE)) FileNetworkOpenInformation);
{ if (status == STATUS_INVALID_PARAMETER
/* This occurs when accessing SMB share root dirs hosted on || status == STATUS_NOT_IMPLEMENTED)
NT4 (STATUS_INVALID_PARAMETER), or when trying to access {
/* Apart from accessing Netapps, this also occurs when
accessing SMB share root dirs hosted on NT4
(STATUS_INVALID_PARAMETER), or when trying to access
SMB share root dirs from NT4 (STATUS_NOT_IMPLEMENTED). */ SMB share root dirs from NT4 (STATUS_NOT_IMPLEMENTED). */
FILE_BASIC_INFORMATION fbi; FILE_BASIC_INFORMATION fbi;
FILE_STANDARD_INFORMATION fsi;
status = NtQueryInformationFile (h, &io, &fbi, sizeof fbi, status = NtQueryInformationFile (h, &io, &fbi, sizeof fbi,
FileBasicInformation); FileBasicInformation);
if (NT_SUCCESS (status)) if (NT_SUCCESS (status))
{ {
memcpy (pfnoi, &fbi, 4 * sizeof (LARGE_INTEGER)); memcpy (pfnoi, &fbi, 4 * sizeof (LARGE_INTEGER));
pfnoi->EndOfFile.QuadPart if (NT_SUCCESS (NtQueryInformationFile (h, &io, &fsi,
= pfnoi->AllocationSize.QuadPart = 0; sizeof fsi,
FileStandardInformation)))
{
pfnoi->EndOfFile.QuadPart = fsi.EndOfFile.QuadPart;
pfnoi->AllocationSize.QuadPart
= fsi.AllocationSize.QuadPart;
}
else
pfnoi->EndOfFile.QuadPart
= pfnoi->AllocationSize.QuadPart = 0;
pfnoi->FileAttributes = fbi.FileAttributes; pfnoi->FileAttributes = fbi.FileAttributes;
} }
} }