mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
temporary directory improvement
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35393 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
dc55974ec8
commit
982982f631
2 changed files with 14 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2012-08-10 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSPathUtilities.m:
|
||||||
|
Fix permissions on temporary directory rarther than just failing ...
|
||||||
|
suggestion by Wolfgang.
|
||||||
|
|
||||||
2012-08-10 Richard Frith-Macdonald <rfm@gnu.org>
|
2012-08-10 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSFileManager.m: ([-createDirectoryAtPath:attributes:])
|
* Source/NSFileManager.m: ([-createDirectoryAtPath:attributes:])
|
||||||
|
|
|
@ -1989,6 +1989,10 @@ NSTemporaryDirectory(void)
|
||||||
if ((perm != 0700 && perm != 0600) || owner != uid)
|
if ((perm != 0700 && perm != 0600) || owner != uid)
|
||||||
{
|
{
|
||||||
NSString *secure;
|
NSString *secure;
|
||||||
|
NSNumber *p = [NSNumber numberWithInt: 0700];
|
||||||
|
|
||||||
|
attr = [NSDictionary dictionaryWithObject: p
|
||||||
|
forKey: NSFilePosixPermissions];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The name of the secure subdirectory reflects the user ID rather
|
* The name of the secure subdirectory reflects the user ID rather
|
||||||
|
@ -2003,10 +2007,6 @@ NSTemporaryDirectory(void)
|
||||||
|
|
||||||
if ([manager fileExistsAtPath: tempDirName] == NO)
|
if ([manager fileExistsAtPath: tempDirName] == NO)
|
||||||
{
|
{
|
||||||
NSNumber *p = [NSNumber numberWithInt: 0700];
|
|
||||||
|
|
||||||
attr = [NSDictionary dictionaryWithObject: p
|
|
||||||
forKey: NSFilePosixPermissions];
|
|
||||||
if ([manager createDirectoryAtPath: tempDirName
|
if ([manager createDirectoryAtPath: tempDirName
|
||||||
withIntermediateDirectories: YES
|
withIntermediateDirectories: YES
|
||||||
attributes: attr
|
attributes: attr
|
||||||
|
@ -2017,6 +2017,10 @@ NSTemporaryDirectory(void)
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[manager changeFileAttributes: attr atPath: tempDirName];
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check that the new directory is really secure.
|
* Check that the new directory is really secure.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue