Fix ownership if necessary.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3767 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-02-21 20:28:19 +00:00
parent 7ec19ca5cf
commit 654fd3068a

View file

@ -616,6 +616,13 @@ failure:
if ([mgr changeFileAttributes: att atPath: path] == NO)
NSLog(@"Unable to correctly set all attributes for '%@'", path);
}
else if (geteuid() == 0 && [@"root" isEqualToString: NSUserName()] == NO)
{
att = [NSDictionary dictionaryWithObjectsAndKeys:
NSFileOwnerAccountName, NSUserName(), nil];
if ([mgr changeFileAttributes: att atPath: path] == NO)
NSLog(@"Unable to correctly set ownership for '%@'", path);
}
}
/* success: */