delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/06/04/20:28:18

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-WM-Posted-At: avacado.atomice.net; Wed, 5 Jun 02 01:31:22 +0100
Message-ID: <00da01c20c28$513750c0$0100a8c0@advent02>
From: "Chris January" <chris AT atomice DOT net>
To: <cygwin AT cygwin DOT com>
References: <20020530032207 DOT GA29644 AT redhat DOT com> <07748651 DOT 20020530131138 AT syntrex DOT com> <20020601024819 DOT GA22455 AT redhat DOT com> <1373896452 DOT 20020603215534 AT gmx DOT net>
Subject: Re: Re[2]: The road to 1.3.11 -- please try the latest snapshot
Date: Wed, 5 Jun 2002 01:31:21 +0100
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

> 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019