mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
We only need to set the ownership of a newly created file on unix-like systems where the effective user ID may be different from the real user ID.
This commit is contained in:
parent
993241f8fb
commit
47b6defc26
1 changed files with 4 additions and 0 deletions
|
@ -1804,6 +1804,7 @@ failure:
|
|||
path, att);
|
||||
}
|
||||
}
|
||||
#ifdef HAVE_GETEUID
|
||||
else if (geteuid() == 0 && [@"root" isEqualToString: NSUserName()] == NO)
|
||||
{
|
||||
att = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
|
@ -1813,6 +1814,7 @@ failure:
|
|||
NSWarnMLog(@"Unable to correctly set ownership for '%@'", path);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* success: */
|
||||
|
@ -1985,6 +1987,7 @@ failure:
|
|||
path, mAtt);
|
||||
}
|
||||
}
|
||||
#ifdef HAVE_GETEUID
|
||||
else if (geteuid() == 0 && [@"root" isEqualToString: NSUserName()] == NO)
|
||||
{
|
||||
att = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
|
@ -1994,6 +1997,7 @@ failure:
|
|||
NSWarnMLog(@"Unable to correctly set ownership for '%@'", path);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* success: */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue