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:
authorChristian Franke <franke@computer.org>2011-05-10 21:19:37 +0400
committerChristian Franke <franke@computer.org>2011-05-10 21:19:37 +0400
commit3bcc74a9ae88b4078a42f41fb9cd6880ab25a834 (patch)
tree4ba03311f3c0b159479550a92107e65f23b12ed2 /winsup/cygwin/security.cc
parentb6151db1045a7f0287908b09dbd8cd00a9edf7f0 (diff)
* security.cc (check_registry_access): Handle missing
security descriptor of HKEY_PERFORMANCE_DATA.
Diffstat (limited to 'winsup/cygwin/security.cc')
-rw-r--r--winsup/cygwin/security.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc
index a52fc26ac..430a65fbc 100644
--- a/winsup/cygwin/security.cc
+++ b/winsup/cygwin/security.cc
@@ -1085,8 +1085,13 @@ check_registry_access (HANDLE hdl, int flags, bool effective)
desired |= KEY_SET_VALUE;
if (flags & X_OK)
desired |= KEY_QUERY_VALUE;
- if (!get_reg_sd (hdl, sd))
+
+ if ((HKEY) hdl == HKEY_PERFORMANCE_DATA)
+ /* RegGetKeySecurity() always fails with ERROR_INVALID_HANDLE. */
+ ret = 0;
+ else if (!get_reg_sd (hdl, sd))
ret = check_access (sd, reg_mapping, desired, flags, effective);
+
/* As long as we can't write the registry... */
if (flags & W_OK)
{