Hans Leidekker hans@it.vu.nl writes:
Changelog:
- Reject wildcards in directory names
There's no need to check in both A and W functions since the A one calls the W one anyway. Also you should only check the part of the filename that is actually being created, and there are probably other invalid characters to check for too.
On Tuesday 18 November 2003 21:17, Alexandre Julliard wrote:
Changelog:
- Reject wildcards in directory names
There's no need to check in both A and W functions since the A one calls the W one anyway. Also you should only check the part of the filename that is actually being created, and there are probably other invalid characters to check for too.
But then the other parameter check is redundant as well:
if (!path || !*path) ...
Should I remove that one from CreateDirectoryA? This is done in other places too by the way. Should I remove those as well?
As for the invalid characters, [Create|Remove]File[A|W] only check for '?', '*', which I just copied for [Create|Remove]Directory[A|W]. I take it you will accept a patch that also extends the checks in [Create|Remove]File*?
-Hans
Hans Leidekker hans@it.vu.nl writes:
But then the other parameter check is redundant as well:
if (!path || !*path) ...
Should I remove that one from CreateDirectoryA? This is done in other places too by the way. Should I remove those as well?
Those that are not needed yes; but make sure you really understand the code first, in some cases the check is needed. In CreateDirectoryA I agree it could be removed.
As for the invalid characters, [Create|Remove]File[A|W] only check for '?', '*', which I just copied for [Create|Remove]Directory[A|W]. I take it you will accept a patch that also extends the checks in [Create|Remove]File*?
Yes, and of course it should use a common routine to do the checks, so that it's consistent everywhere. Also the Create and Remove cases should be handled differently IMO, a Remove should succeed if the specified file exists, even if it contains illegal characters.