diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index b84613694..9ce670718 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2011-05-10 Christian Franke + + * security.cc (check_registry_access): Handle missing + security descriptor of HKEY_PERFORMANCE_DATA. + 2011-05-10 Corinna Vinschen * lc_msg.h: Regenerate. 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) {