aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-11-23 09:26:16 +0000
committerCorinna Vinschen <corinna@vinschen.de>2010-11-23 09:26:16 +0000
commit5fe7c5e01b082d749eb8fc0f0afc3b6c3c0e068f (patch)
tree680053f0203b17a566d5775331ad7c4bedbaab6e
parent8b6fbbba1093760bfc12c4c7a0c05c61dd5caeb1 (diff)
downloadnewlib-5fe7c5e01b082d749eb8fc0f0afc3b6c3c0e068f.zip
newlib-5fe7c5e01b082d749eb8fc0f0afc3b6c3c0e068f.tar.gz
newlib-5fe7c5e01b082d749eb8fc0f0afc3b6c3c0e068f.tar.bz2
* 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.
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/path.cc33
2 files changed, 29 insertions, 10 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 9625363..80a35ef 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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>
* mount.cc (NETAPP_IGNORE): Add FILE_PERSISTENT_ACLS.
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index ebd613e..eb0fdbe 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2388,24 +2388,37 @@ restart:
{
PFILE_NETWORK_OPEN_INFORMATION pfnoi = conv_hdl.fnoi ();
- status = NtQueryInformationFile (h, &io, pfnoi, sizeof *pfnoi,
- FileNetworkOpenInformation);
- if ((status == STATUS_INVALID_PARAMETER
- || status == STATUS_NOT_IMPLEMENTED)
- && RtlEqualUnicodePathPrefix (&upath, &ro_u_uncp, FALSE))
- {
- /* This occurs when accessing SMB share root dirs hosted on
- NT4 (STATUS_INVALID_PARAMETER), or when trying to access
+ /* Netapps don't implement FileNetworkOpenInformation. */
+ status = fs.is_netapp ()
+ ? STATUS_INVALID_PARAMETER
+ : NtQueryInformationFile (h, &io, pfnoi, sizeof *pfnoi,
+ FileNetworkOpenInformation);
+ if (status == STATUS_INVALID_PARAMETER
+ || status == STATUS_NOT_IMPLEMENTED)
+ {
+ /* 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). */
FILE_BASIC_INFORMATION fbi;
+ FILE_STANDARD_INFORMATION fsi;
status = NtQueryInformationFile (h, &io, &fbi, sizeof fbi,
FileBasicInformation);
if (NT_SUCCESS (status))
{
memcpy (pfnoi, &fbi, 4 * sizeof (LARGE_INTEGER));
- pfnoi->EndOfFile.QuadPart
- = pfnoi->AllocationSize.QuadPart = 0;
+ if (NT_SUCCESS (NtQueryInformationFile (h, &io, &fsi,
+ 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;
}
}