[Patch]: NUL and other special names

Christopher Faylor cgf-no-personal-reply-please@cygwin.com
Tue Jun 1 21:06:00 GMT 2004

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?


More information about the Cygwin-patches mailing list