Skip to content

Commit

Permalink
Allow fchmod and futimes to happen if we're effectively root
Browse files Browse the repository at this point in the history
  • Loading branch information
erikkemperman committed Jan 17, 2016
1 parent a456986 commit 8476dc8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/dest/writeContents/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ function writeContents(writePath, file, cb) {
return close(null, finish);
}

// Check access, `futimes` and `fchmod` only work if we own the file
// Check access, `futimes` and `fchmod` only work if we own the file,
// or if we are effectively root.
var uid = process.geteuid ? process.geteuid() : process.getuid();
if (stat.uid !== uid) {
if (stat.uid !== uid && uid !== 0) {
return close(null, finish);
}

Expand Down

0 comments on commit 8476dc8

Please sign in to comment.