diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2016-12-13 14:48:05 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2016-12-13 14:48:05 +0300 |
commit | 563dda82591bddb213f1771a63de534e11602cd8 (patch) | |
tree | dc20fff9a3dfbcd4cd5a1cd5c052f6e5a7956a95 | |
parent | 937a2d92e20a47587d6d0634255df5796b893306 (diff) |
Fix incorrect path conversion on non-existent files on network shares
NtOpenFile/NtCreateFile on non-existent paths on network drives has a
bug. Assuming a path Z:\dir\file. Further assuming that Z:\dir does
not exist.
The first NtOpenFile("Z:\dir\file") correctly returns
STATUS_OBJECT_PATH_NOT_FOUND. Subsequent calls incorrectly
return STATUS_OBJECT_NAME_NOT_FOUND.
This appears to be some kind of caching behaviour. Waiting a while
before repeating the call correctly returns STATUS_OBJECT_PATH_NOT_FOUND
again.
This patch works around the observed misbehaviour.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r-- | winsup/cygwin/path.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index c6f7c1d27..c3b304ab5 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -2810,6 +2810,13 @@ restart: || status == STATUS_NO_MEDIA_IN_DEVICE) { set_error (ENOENT); + if (ext_tacked_on && !had_ext) + { + *ext_here = '\0'; + ext_tacked_on = false; + ext_here = NULL; + extn = 0; + } goto file_not_symlink; } if (status != STATUS_OBJECT_NAME_NOT_FOUND |