Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2013-03-27 14:23:05 +0400
committerCorinna Vinschen <corinna@vinschen.de>2013-03-27 14:23:05 +0400
commitcc5913f6d483db66eb284a48d8a6655ed9851432 (patch)
tree057309c0536316aaf80cfeef7c7348a5d73f3a1a
parent2a6fc2c93bee114e0f9d3387216c929be220480e (diff)
* ntdll.h (STATUS_NETWORK_OPEN_RESTRICTION): Define.
(STATUS_SYMLINK_CLASS_DISABLED): Define. * path.cc (symlink_info::check): Handle STATUS_NETWORK_OPEN_RESTRICTION and STATUS_SYMLINK_CLASS_DISABLED status codes. Explain why.
-rw-r--r--winsup/cygwin/ChangeLog.64bit7
-rw-r--r--winsup/cygwin/ntdll.h10
-rw-r--r--winsup/cygwin/path.cc16
3 files changed, 32 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog.64bit b/winsup/cygwin/ChangeLog.64bit
index c10a688b7..ac23149f6 100644
--- a/winsup/cygwin/ChangeLog.64bit
+++ b/winsup/cygwin/ChangeLog.64bit
@@ -1,3 +1,10 @@
+2013-03-27 Corinna Vinschen <corinna@vinschen.de>
+
+ * ntdll.h (STATUS_NETWORK_OPEN_RESTRICTION): Define.
+ (STATUS_SYMLINK_CLASS_DISABLED): Define.
+ * path.cc (symlink_info::check): Handle STATUS_NETWORK_OPEN_RESTRICTION
+ and STATUS_SYMLINK_CLASS_DISABLED status codes. Explain why.
+
2013-03-22 Kai Tietz <ktietz@redhat.com>
* gendef: Use pause instead of calling yield throughout in x86_64 code.
diff --git a/winsup/cygwin/ntdll.h b/winsup/cygwin/ntdll.h
index 715de81c0..4d302ffe7 100644
--- a/winsup/cygwin/ntdll.h
+++ b/winsup/cygwin/ntdll.h
@@ -1,7 +1,7 @@
/* ntdll.h. Contains ntdll specific stuff not defined elsewhere.
Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
- 2011, 2012 Red Hat, Inc.
+ 2011, 2012, 2013 Red Hat, Inc.
This file is part of Cygwin.
@@ -16,6 +16,14 @@
/* custom status code: */
#define STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION ((NTSTATUS) 0xe0000269)
+/* As of March 2013, Mingw doesn't define these status codes yet. */
+#ifndef STATUS_NETWORK_OPEN_RESTRICTION
+#define STATUS_NETWORK_OPEN_RESTRICTION ((NTSTATUS)0xC0000201)
+#endif
+#ifndef STATUS_SYMLINK_CLASS_DISABLED
+#define STATUS_SYMLINK_CLASS_DISABLED ((NTSTATUS)0xC0000715)
+#endif
+
#define NtCurrentProcess() ((HANDLE) (LONG_PTR) -1)
#define NtCurrentThread() ((HANDLE) (LONG_PTR) -2)
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index ca6a98a88..92d332b32 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2480,6 +2480,22 @@ restart:
}
}
}
+ else if (status == STATUS_NETWORK_OPEN_RESTRICTION
+ || status == STATUS_SYMLINK_CLASS_DISABLED)
+ {
+ /* These status codes are returned if you try to open a native
+ symlink and the usage of this kind of symlink is forbidden
+ (see fsutil). Since we can't open them at all, not even for
+ stat purposes, we have to return a POSIX error code which is
+ at least a bit helpful.
+
+ Additionally Windows 8 introduces a bug in NFS: If you have
+ a symlink to a directory, with symlinks underneath, resolving
+ the second level of symlinks fails if remote->remote symlinks
+ are disabled in fsutil. Unfortunately that's the default. */
+ set_error (ELOOP);
+ break;
+ }
if (NT_SUCCESS (status)
/* Check file system while we're having the file open anyway.