mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Raise exception on attempt to remove illegal paths.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@10180 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e73e95fca3
commit
5ac543a086
1 changed files with 9 additions and 2 deletions
|
@ -541,9 +541,16 @@ static NSFileManager* defaultManager = nil;
|
|||
BOOL is_dir;
|
||||
const char *cpath;
|
||||
|
||||
if (handler != nil)
|
||||
[handler fileManager: self willProcessPath: path];
|
||||
if ([path isEqualToString: @"."] || [path isEqualToString: @".."])
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
format: @"Attempt to remove illegal path"];
|
||||
}
|
||||
|
||||
if (handler != nil)
|
||||
{
|
||||
[handler fileManager: self willProcessPath: path];
|
||||
}
|
||||
cpath = [self fileSystemRepresentationWithPath: path];
|
||||
if (cpath == 0 || *cpath == '\0')
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue