diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2011-05-05 10:45:21 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2011-05-05 10:45:21 +0400 |
commit | 2849cbde549bbc9e66c6b409ee60e47880b11490 (patch) | |
tree | df1deeba7f86b0044cfce66f05fde3fd3c470f55 /winsup/cygwin/fhandler_registry.cc | |
parent | 5069a2b0d9533b36f55928728d1b1bffedc43545 (diff) |
* fhandler_registry.cc (fhandler_registry::exists): Fix regression
in EACCES handling.
(fhandler_registry::open): Fix "%val" case.
Diffstat (limited to 'winsup/cygwin/fhandler_registry.cc')
-rw-r--r-- | winsup/cygwin/fhandler_registry.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_registry.cc b/winsup/cygwin/fhandler_registry.cc index f2e80ce11..8d3ed2e72 100644 --- a/winsup/cygwin/fhandler_registry.cc +++ b/winsup/cygwin/fhandler_registry.cc @@ -317,10 +317,12 @@ fhandler_registry::exists () if (!val_only) hKey = open_key (path, KEY_READ, wow64, false); - if (hKey != (HKEY) INVALID_HANDLE_VALUE || get_errno () == EACCES) + if (hKey != (HKEY) INVALID_HANDLE_VALUE) file_type = virt_directory; else { + /* Key does not exist or open failed with EACCES, + enumerate subkey and value names of parent key. */ hKey = open_key (path, KEY_READ, wow64, true); if (hKey == (HKEY) INVALID_HANDLE_VALUE) return virt_none; @@ -797,7 +799,7 @@ fhandler_registry::open (int flags, mode_t mode) handle = open_key (path, KEY_READ, wow64, false); if (handle == (HKEY) INVALID_HANDLE_VALUE) { - if (get_errno () != EACCES) + if (val_only || get_errno () != EACCES) handle = open_key (path, KEY_READ, wow64, true); if (handle == (HKEY) INVALID_HANDLE_VALUE) { |