This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: False positive from access("/proc/registry/...", F_OK)

Corinna Vinschen wrote:
On Apr 27 12:26, Christian Franke wrote:
Problem was likely introduced by change 1.52:

  fhandler_registry::exists ()
    if (!val_only)
      hKey = open_key (path, KEY_READ, wow64, false);
  + if (hKey != (HKEY) INVALID_HANDLE_VALUE || get_errno () == EACCES)
      file_type = 1;

open_key() returns INVALID_HANDLE_VALUE and EACCESS also if an upper
level key cannot be opened. The exists() function returns 1
(virt_directory) then, it should return 0 (virt_none).
I don't remember anymore why I did that and naturally I also didn't
write a comment.


I presume this fixed the access-denied-on-last-component case:

"/proc/registry/HKEY_LOCAL_MACHINE/SECURITY" -> filetype = 1 (OK)

but unfortunately then the same info is returned for all ".../SECURITY/*".

But what you say sounds right to me. Please create a patch.

I'll try next week. A fix likely needs to enhance open_key() such that it returns info whether the access was denied on last component or not.


-- Problem reports: FAQ: Documentation: Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]