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

@ -32,7 +32,7 @@ struct MakeReadOnly
{
try {
/* This will make the path read-only. */
if (path != "") canonicalisePathMetaData(path, false, -1);
if (path != "") canonicaliseTimestampAndPermissions(path);
} catch (...) {
ignoreException();
}