Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.8.6 breaks certain existing .zip packages #2532

Closed
ryanwitt opened this issue Jan 17, 2019 · 5 comments
Closed

1.8.6 breaks certain existing .zip packages #2532

ryanwitt opened this issue Jan 17, 2019 · 5 comments

Comments

@ryanwitt
Copy link

ryanwitt commented Jan 17, 2019

@sheerun, unfortunately, looks like the security upgrade on decompress-zip may have had the side effect of breaking .zip archives with certain permissions set on a non-empty directory.

Not sure how many packages this affects, but hit one old one in a build. Pinning bower at v1.8.4 works around the issue.

Output of bower -v && npm -v && node -v:

1.8.6
3.10.10
v6.16.0

Additional environment details (proxy, private registry, etc.):

both macOS and Ubuntu 16.04

Steps to reproduce the issue:

  1. Install bower 1.8.6
  2. Install an affected zipfile:
bower install https://github.com/harvesthq/chosen/releases/download/v1.1.0/chosen_v1.1.0.zip
  1. Encounter permissions errors

Describe the results you received:

Directories inside the archive can end up extracted without +x set, resulting in an access error trying to extract files inside that directory:

bower chosen_v1.1.0#*           cached https://github.com/harvesthq/chosen/releases/download/v1.1.0/chosen_v1.1.0.zip#e-tag:face03d32
bower chosen_v1.1.0#*         validate e-tag:face03d32 against https://github.com/harvesthq/chosen/releases/download/v1.1.0/chosen_v1.1.0.zip#*
bower chosen_v1.1.0#*              new version for https://github.com/harvesthq/chosen/releases/download/v1.1.0/chosen_v1.1.0.zip#*
bower chosen_v1.1.0#*          resolve https://github.com/harvesthq/chosen/releases/download/v1.1.0/chosen_v1.1.0.zip#*
bower chosen_v1.1.0#*         download https://github.com/harvesthq/chosen/releases/download/v1.1.0/chosen_v1.1.0.zip
bower chosen_v1.1.0#*          extract chosen_v1.1.0.zip
bower chosen_v1.1.0#*           EACCES EACCES: permission denied, open '/var/folders/.../docsupport/oss-credit.png'

Stack trace:
Error: EACCES: permission denied, open '/var/folders/.../tmp/.../docsupport/oss-credit.png'
    at Error (native)

Console trace:
Error
    at StandardRenderer.error (node_modules/bower/lib/renderers/StandardRenderer.js:88:37)
    at Logger.<anonymous> (node_modules/bower/lib/bin/bower.js:113:30)
    at emitOne (events.js:96:13)
    at Logger.emit (events.js:188:7)
    at Logger.emit (node_modules/bower/lib/node_modules/bower-logger/lib/Logger.js:29:39)
    at node_modules/bower/lib/commands/index.js:49:24
    at _rejected (node_modules/q/q.js:864:24)
    at node_modules/bower/lib/node_modules/q/q.js:890:30
    at Promise.when (node_modules/bower/lib/node_modules/q/q.js:1142:31)
    at Promise.promise.promiseDispatch (node_modules/bower/lib/node_modules/q/q.js:808:41)
System info:
Bower version: 1.8.6
Node version: 6.16.0
OS: Darwin 18.2.0 x64

Permissions on the docusupport directory in this case are drw-r--r-- and should probably be drwxr--r--.

Describe the results you expected:

Package installed without error.

bower chosen_v1.1.0#*           cached https://github.com/harvesthq/chosen/releases/download/v1.1.0/chosen_v1.1.0.zip#e-tag:face03d32
bower chosen_v1.1.0#*         validate e-tag:face03d32 against https://github.com/harvesthq/chosen/releases/download/v1.1.0/chosen_v1.1.0.zip#*
bower chosen_v1.1.0#*              new version for https://github.com/harvesthq/chosen/releases/download/v1.1.0/chosen_v1.1.0.zip#*
bower chosen_v1.1.0#*          resolve https://github.com/harvesthq/chosen/releases/download/v1.1.0/chosen_v1.1.0.zip#*
bower chosen_v1.1.0#*         download https://github.com/harvesthq/chosen/releases/download/v1.1.0/chosen_v1.1.0.zip
bower chosen_v1.1.0#*          extract chosen_v1.1.0.zip
bower chosen_v1.1.0#*         resolved https://github.com/harvesthq/chosen/releases/download/v1.1.0/chosen_v1.1.0.zip#e-tag:face03d32

Additional information:

bower diff v1.8.4...v1.8.6
decompress-zip diff bower/decompress-zip@867e439...v0.3.2

@ryanwitt
Copy link
Author

ryanwitt commented Jan 17, 2019

@sheerun I'm guessing it was the "Enable file mode preservation" feature in decompress-zip@v0.3.0.

@sheerun
Copy link
Contributor

sheerun commented Jan 17, 2019

Thanks for noticing.. I've published 1.8.8 which should fix this regression. Mind to check?

@ryanwitt
Copy link
Author

ryanwitt commented Jan 18, 2019

Seems to work on 1.8.7 which I guess is the pre-release?

@sheerun
Copy link
Contributor

sheerun commented Jan 18, 2019

It is not release, thank you

@sheerun sheerun closed this as completed Jan 18, 2019
@sheerun
Copy link
Contributor

sheerun commented Jan 18, 2019

not -> now a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants