| Index: node_modules/vulcanize/node_modules/update-notifier/node_modules/configstore/node_modules/graceful-fs/polyfills.js
|
| diff --git a/node_modules/karma/node_modules/graceful-fs/polyfills.js b/node_modules/vulcanize/node_modules/update-notifier/node_modules/configstore/node_modules/graceful-fs/polyfills.js
|
| similarity index 83%
|
| copy from node_modules/karma/node_modules/graceful-fs/polyfills.js
|
| copy to node_modules/vulcanize/node_modules/update-notifier/node_modules/configstore/node_modules/graceful-fs/polyfills.js
|
| index afc83b3f2c5ef08a262807698a17a942d054ae16..9d62af586172964da962c0a0b8ca94f017580ccd 100644
|
| --- a/node_modules/karma/node_modules/graceful-fs/polyfills.js
|
| +++ b/node_modules/vulcanize/node_modules/update-notifier/node_modules/configstore/node_modules/graceful-fs/polyfills.js
|
| @@ -1,4 +1,4 @@
|
| -var fs = require('fs')
|
| +var fs = require('./fs.js')
|
| var constants = require('constants')
|
|
|
| var origCwd = process.cwd
|
| @@ -116,15 +116,25 @@ if (!fs.lutimes) {
|
|
|
| // https://github.com/isaacs/node-graceful-fs/issues/4
|
| // Chown should not fail on einval or eperm if non-root.
|
| +// It should not fail on enosys ever, as this just indicates
|
| +// that a fs doesn't support the intended operation.
|
|
|
| fs.chown = chownFix(fs.chown)
|
| fs.fchown = chownFix(fs.fchown)
|
| fs.lchown = chownFix(fs.lchown)
|
|
|
| +fs.chmod = chownFix(fs.chmod)
|
| +fs.fchmod = chownFix(fs.fchmod)
|
| +fs.lchmod = chownFix(fs.lchmod)
|
| +
|
| fs.chownSync = chownFixSync(fs.chownSync)
|
| fs.fchownSync = chownFixSync(fs.fchownSync)
|
| fs.lchownSync = chownFixSync(fs.lchownSync)
|
|
|
| +fs.chmodSync = chownFix(fs.chmodSync)
|
| +fs.fchmodSync = chownFix(fs.fchmodSync)
|
| +fs.lchmodSync = chownFix(fs.lchmodSync)
|
| +
|
| function chownFix (orig) {
|
| if (!orig) return orig
|
| return function (target, uid, gid, cb) {
|
| @@ -146,15 +156,32 @@ function chownFixSync (orig) {
|
| }
|
| }
|
|
|
| +// ENOSYS means that the fs doesn't support the op. Just ignore
|
| +// that, because it doesn't matter.
|
| +//
|
| +// if there's no getuid, or if getuid() is something other
|
| +// than 0, and the error is EINVAL or EPERM, then just ignore
|
| +// it.
|
| +//
|
| +// This specific case is a silent failure in cp, install, tar,
|
| +// and most other unix tools that manage permissions.
|
| +//
|
| +// When running as root, or if other types of errors are
|
| +// encountered, then it's strict.
|
| function chownErOk (er) {
|
| - // if there's no getuid, or if getuid() is something other than 0,
|
| - // and the error is EINVAL or EPERM, then just ignore it.
|
| - // This specific case is a silent failure in cp, install, tar,
|
| - // and most other unix tools that manage permissions.
|
| - // When running as root, or if other types of errors are encountered,
|
| - // then it's strict.
|
| - if (!er || (!process.getuid || process.getuid() !== 0)
|
| - && (er.code === "EINVAL" || er.code === "EPERM")) return true
|
| + if (!er)
|
| + return true
|
| +
|
| + if (er.code === "ENOSYS")
|
| + return true
|
| +
|
| + var nonroot = !process.getuid || process.getuid() !== 0
|
| + if (nonroot) {
|
| + if (er.code === "EINVAL" || er.code === "EPERM")
|
| + return true
|
| + }
|
| +
|
| + return false
|
| }
|
|
|
|
|
|
|