diff --git a/ChangeLog b/ChangeLog index e9635da3d..2762770b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-08-10 Richard Frith-Macdonald + + * Source/NSPathUtilities.m: + Fix permissions on temporary directory rarther than just failing ... + suggestion by Wolfgang. + 2012-08-10 Richard Frith-Macdonald * Source/NSFileManager.m: ([-createDirectoryAtPath:attributes:]) diff --git a/Source/NSPathUtilities.m b/Source/NSPathUtilities.m index d36a068bd..81e8de2a1 100644 --- a/Source/NSPathUtilities.m +++ b/Source/NSPathUtilities.m @@ -1989,6 +1989,10 @@ NSTemporaryDirectory(void) if ((perm != 0700 && perm != 0600) || owner != uid) { NSString *secure; + NSNumber *p = [NSNumber numberWithInt: 0700]; + + attr = [NSDictionary dictionaryWithObject: p + forKey: NSFilePosixPermissions]; /* * The name of the secure subdirectory reflects the user ID rather @@ -2003,10 +2007,6 @@ NSTemporaryDirectory(void) if ([manager fileExistsAtPath: tempDirName] == NO) { - NSNumber *p = [NSNumber numberWithInt: 0700]; - - attr = [NSDictionary dictionaryWithObject: p - forKey: NSFilePosixPermissions]; if ([manager createDirectoryAtPath: tempDirName withIntermediateDirectories: YES attributes: attr @@ -2017,6 +2017,10 @@ NSTemporaryDirectory(void) return nil; } } + else + { + [manager changeFileAttributes: attr atPath: tempDirName]; + } /* * Check that the new directory is really secure.