Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-10-12 21:46:03 +0400
committerisaacs <i@izs.me>2011-10-12 21:46:03 +0400
commitc1a38a0d5f6d64c9373bb1c971ee0a28def6221c (patch)
treee16ac8d1dc41a4e37add1ab68ac30f8fb0d93152 /lib
parent9fa5ca2b66a9923564d8a4ff8c2381d84587560b (diff)
close #1542 don't chown if uid/gid aren't numbers
Diffstat (limited to 'lib')
-rw-r--r--lib/cache.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/cache.js b/lib/cache.js
index dc4d0def2..6cf188c30 100644
--- a/lib/cache.js
+++ b/lib/cache.js
@@ -603,7 +603,9 @@ function addPlacedTarball_ (p, name, uid, gid, cb) {
log.verbose(FMODE.toString(8), "chmod "+f)
fs.chmod(f, FMODE, cb)
}, function (f, cb) {
- fs.chown(f, uid, gid, cb)
+ if (typeof uid === "number" && typeof gid === "number") {
+ fs.chown(f, uid, gid, cb)
+ } else cb()
}, function (er) {
cb(er, data)
})