This is the mail archive of the cygwin@cygwin.com 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: Re[2]: The road to 1.3.11 -- please try the latest snapshot


> Ok now - there is this comment in at the start
> fhandler_registry::exists().. Could someone sched more light (Chris J
> maybe :) ) why is this necessary ? Any links pointers would be
> appreciated... I havent searched too hard the MSDN but there doesnt
> seem to be too much info on the securiy of the registry :(
>
> Here is the comment I refer to:
>
> /* Returns 0 if path doesn't exist, >0 if path is a directory,
>  * <0 if path is a file.
>  *
>  * We open the last key but one and then enum it's sub-keys and values to
see if
>  the
>  * final component is there. This gets round the problem of not having
security
> access
>  * to the final key in the path.
>  */
>
>
> So if we could avoid the RegEnumEntryEx thing i.e. just use
> RegOpenKeyEx this would speed up the process very much.
You're right, it would speed things up considerably.
The reason I did things that way is because a key, for which you have enum
permissions, may have a subkey for which you have no permissions at all (and
so would fail on RegOpenKeyEx).
In retrospect, the correct implementation is to try RegOpenKeyEx first, then
try the enum method if and only if RegOpenKeyEx fails with
ERROR_ACCESS_DENIED. I will try to make a patch for this as soon as a I have
a free minute (not easy at present). Alternatively feel free to submit your
own patch once your copyright assignment has been received by Red Hat.
Please note I haven't looked at your patch for unlink or rmdir and won't do
so until your assignment has been received. That way I can generate my own
patch with the same functionality if need be.

Regards
Chris



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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