Fix error copying directories.

Fix bundle for base library.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22621 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2006-03-08 14:25:55 +00:00
parent 4e1daaff84
commit 48d81791bc
3 changed files with 16 additions and 9 deletions

View file

@ -950,6 +950,8 @@ static NSStringEncoding defaultEncoding;
fileType = [attrs fileType];
if ([fileType isEqualToString: NSFileTypeDirectory] == YES)
{
NSMutableDictionary *mattrs;
/* If destination directory is a descendant of source directory copying
isn't possible. */
if ([[destination stringByAppendingString: @"/"]
@ -960,6 +962,17 @@ static NSStringEncoding defaultEncoding;
[self _sendToHandler: handler willProcessPath: destination];
/*
* Don't attempt to retain ownership of copy ... we want the copy
* to be owned by the current user.
*/
mattrs = [attrs mutableCopy];
[mattrs removeObjectForKey: NSFileOwnerAccountID];
[mattrs removeObjectForKey: NSFileGroupOwnerAccountID];
[mattrs removeObjectForKey: NSFileGroupOwnerAccountName];
[mattrs setObject: NSUserName() forKey: NSFileOwnerAccountName];
attrs = AUTORELEASE(mattrs);
if ([self createDirectoryAtPath: destination attributes: attrs] == NO)
{
return [self _proceedAccordingToHandler: handler