Refactoring: Split off the non-recursive canonicalisePathMetaData()

Also, change the file mode before changing the owner.  This prevents a
slight time window in which a setuid binary would be setuid root.
This commit is contained in:
Eelco Dolstra 2013-02-27 16:35:46 +01:00
parent 826dc0d07d
commit b008674e46
3 changed files with 52 additions and 37 deletions

View file

@ -309,7 +309,7 @@ private:
in a setuid Nix installation. */
void canonicalisePathMetaData(const Path & path, uid_t fromUid);
void canonicalisePathMetaData(const Path & path, bool recurse, uid_t fromUid);
void canonicaliseTimestampAndPermissions(const Path & path);
MakeError(PathInUse, Error);