Permalink
Browse files

Don't clobber executable flags

  • Loading branch information...
1 parent 6d6990c commit 0f026a1f8796e1e0b691f901edb5510454003f5b @isaacs isaacs committed Mar 13, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/utils/tar.js
View
4 lib/utils/tar.js
@@ -214,9 +214,13 @@ function gunzTarPerm (tarball, target, dMode, fMode, uid, gid, cb_) {
function extractEntry (entry) {
// never create things that are user-unreadable,
// or dirs that are user-un-listable. Only leads to headaches.
+ var originalMode = entry.mode = entry.mode || entry.props.mode
entry.mode = entry.mode | (entry.type === "Directory" ? dMode : fMode)
entry.mode = entry.mode & (~npm.modes.umask)
entry.props.mode = entry.mode
+ if (originalMode !== entry.mode) {
+ log.silly([entry.path, originalMode, entry.mode], "modified mode")
+ }
// if there's a specific owner uid/gid that we want, then set that
if (process.platform !== "win32" &&

0 comments on commit 0f026a1

Please sign in to comment.