This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [Patch] Avoid duplicate names in /proc/registry (which may crash find)
On Dec 13 14:37, Christian Franke wrote:
> Corinna Vinschen wrote:
>> On Dec 12 18:32, Christian Franke wrote:
>>
>>> Why not encode "@" as a reserved name like it is already done for "." and
>>> ".." (which appear as "%2E" and "%2E.")? This would provide backward
>>> compatibility and consistency with current conversions:
>>>
>>> @ - default value
>>> %40 - named key or value
>>> %40%val - named value if key exists
>>>
>>> I will post a patch.
>>>
>>
>> Perfect.
>>
>>
>
> As a side effect, the patch fixes an old bug:
> stat("/proc/registry/.../@", .) did not set st_size.
>
>
> 2008-12-13 Christian Franke <franke@computer.org>
>
> * fhandler_registry.cc (DEFAULT_VALUE_NAME): Remove constant.
> (encode_regname): Encode empty (default) name to "@".
> Encode "@" to "%40". Change error return to -1.
> (decode_regname): Decode "@" to empty name. Decode "%40" to "@".
> (fhandler_registry::exists): Skip check for keys if name is empty.
> Remove check for DEFAULT_VALUE_NAME, now handled by decode_regname ().
> (fhandler_registry::readdir): Remove check for empty name, now
> handled by encode_regname ().
> (fhandler_registry::open): Remove check for DEFAULT_VALUE_NAME.
> (fhandler_registry::open_key): Fail with ENOENT if key name is empty.
Thanks for the patch. Can you resend it against the latest version
of fhandler_registry.cc, please? It doesn't apply cleanly anymore.
Thanks,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat