This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
Re: [Patch]: NUL and other special names
- From: Christopher Faylor <cgf-no-personal-reply-please at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Tue, 1 Jun 2004 15:18:18 -0400
- Subject: Re: [Patch]: NUL and other special names
- References: <3.0.5.32.20040531184611.0080be60@incoming.verizon.net>
- Reply-to: cygwin-patches at cygwin dot com
On Mon, May 31, 2004 at 06:46:11PM -0400, Pierre A. Humblet wrote:
>This patch prevents NtCreateFile from creating files with special
>names such as NUL.
>Because this needs to be checked very often, I tried to code it
>efficiently with a binary search (it can perhaps be reused elsewhere).
>
>The new function is_special_name() overlaps with special_name(),
>although there are small differences (it was designed from tests
>on XP Home Ed). Perhaps these two can be merged one day.
Haven't we already done a "GetFileAttributes" on the path by the time
it reaches the NtCreateFile? If so, couldn't we just avoid trying to
create a file which has "bad" attributes?
cgf