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

Ubuntu - Decompressed folder is left without any permissions 0000 #24

Closed
roeeyud opened this issue Apr 26, 2015 · 17 comments
Closed

Ubuntu - Decompressed folder is left without any permissions 0000 #24

roeeyud opened this issue Apr 26, 2015 · 17 comments

Comments

@roeeyud
Copy link

roeeyud commented Apr 26, 2015

When I run my server in Ubuntu (Ubuntu 14.04 LTS) the decompressed destination folder is left without any permissions.

var decompress = new Decompress({mode: '755'});
decompress.src(file).dest(destFolder).use(Decompress.zip).run(function (err) {
if (err)
throw err;
});

I get a Error: EACCES, open

When I check destFolder I find it was created without any permissions (octal: 0000).

This forces me to run as sudo which really isn't ideal.
Please help.

@shinnn
Copy link
Collaborator

shinnn commented Apr 26, 2015

For now you can use the mode option to fix file permissions.

@roeeyud
Copy link
Author

roeeyud commented Apr 26, 2015

I use '755' when calling Decompress.
Still didn't work.
On 26 Apr 2015 09:23, "Shinnosuke Watanabe" notifications@github.com
wrote:

For now you can use the mode option
https://github.com/kevva/decompress#optionsmode to fix file permissions.


Reply to this email directly or view it on GitHub
#24 (comment).

@headcr4sh
Copy link

I have encountered the same issue here. Permissions are always set to '000' and the "mode" option doesn't seem to work.

@kevva
Copy link
Owner

kevva commented May 29, 2015

I am redoing this module so expect a fix soon-ish.

@piranna
Copy link

piranna commented Jun 4, 2015

I have the same problem when downloading a zip file (if this helps):

const GENFATFS_URL="https://github.com/NodeOS/genfatfs/archive/master.zip"
const SRC_DIR='deps/genfatfs'

  Download({ extract: true, strip: 1 })
  .get(GENFATFS_URL, SRC_DIR)
//  .use(progress())
  .run(function(error)
  {
    ...
  ])

@joeljeske
Copy link

I am also getting this error. It is fixed by running as sudo but this isn't good.

+1

@AndreasPizsa
Copy link

+1

@einfallstoll
Copy link

Since Decompress seems to be the only nice unzipper for node.js, I built a small workaround using chmodr from isaacs:

new Decompress()
.src(sourcePath)
.dest(destinationPath)
.use(Decompress.zip({
    strip: 1
}))
.run(function(error) {
    if (error) {
        console.error(error);
    } else {
        chmodr(destinationPath, 0644, callback);
    }
});

Update: Only works for flat ZIP files. Use the fix from below.

@FokkeZB
Copy link

FokkeZB commented Aug 25, 2015

@einfallstoll that doesn't work (for me) since run itself will fail with an EACCESS if the zip contains files in subdirectories.

@FokkeZB
Copy link

FokkeZB commented Aug 25, 2015

Patching decompress-unzip (3.3.0) with kevva/decompress-unzip#10 fixes it.

Please @kevva get it merged and do a patch release of decompress with the updated unzip.

@einfallstoll
Copy link

@FokkeZB Oh, I see. I only decompressed flat zips so far.

As long as it's not merged it should work to npm install TrySound/decompress-unzip --save.

@jlines
Copy link

jlines commented Aug 31, 2015

+1

@stefanmaric
Copy link

Having the same issue. Trying to unzip a file on Ubuntu gives a EACCES error.

@guy-mograbi-at-gigaspaces

+1 me too.. very urgent, last sprint.. :(

I see it in centos too..

However - I don't see it in unit testing.. which is weird. when I run a test, it seems to extract well.
Can anyone else confirm please?

UPDATE - seems some zip files (still containing multiple folders) are extracted well. so this bug does not apply to all archives..

Here is a link to a zip file that I successfully extracted.
https://www.dropbox.com/s/rx9qj8u720teta6/test_file.zip?dl=1

Can anyone help pin point the scenarios in which is happens?

@w33ble
Copy link

w33ble commented Dec 8, 2015

Just ran in to this on OSX too. Even with using a flat zip, the files it writes are all permission 000.

@dainis dainis mentioned this issue Apr 12, 2016
@kevva
Copy link
Owner

kevva commented May 20, 2016

Should be fixed in 4.0.0. Let me know if it isn't.

@kevva kevva closed this as completed May 20, 2016
@SamVerschueren
Copy link
Collaborator

                                                                                                                                                                                                                       '''‎''''''                                                                                                                                                                                                   Sent from my BlackBerry 10 smartphone.'                                                                                                                                                                                                                From: Kevin MårtenssonSent: Friday 20 May 2016 17:30To: kevva/decompres'''sReply To: kevva/deco'mpressSubject: Re: [':'kevva/decompress] Ubuntu - Decompresse'd folder is left without any permissio'n''')'','''''''''''''€s 0000 .;3/,€6'956££:$`'`'$$'``,£$`''''(#24')‎''',''''''''''''‎'''''

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

Successfully merging a pull request may close this issue.