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

Permissions of download not default of user #359

Closed
joegeorgeson opened this issue May 14, 2024 · 3 comments
Closed

Permissions of download not default of user #359

joegeorgeson opened this issue May 14, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@joegeorgeson
Copy link

joegeorgeson commented May 14, 2024

Versions
conda package: 16.15.0-ha770c72_2

$ datasets --version
datasets version: 16.15.0

Describe the bug
Any downloaded file has '600' permissions, but not the default of the user.

Note that in the example below:

  • the ftp download has -rw-r----- permissions (640)
  • the datasets download has -rw------- permissions (600)

To Reproduce
Below is an example comparing an ftp download with a datasets download.

(ncbi-datasets) [user@node folder]$ wget https://ftp.ncbi.nlm.nih.gov/genomes/all/GCA/000/009/045/GCA_000009045.1_ASM904v1/GCA_000009045.1_ASM904v1_genomic.fna.gz
(ncbi-datasets) [user@node folder]$ gunzip GCA_000009045.1_ASM904v1_genomic.fna.gz
(ncbi-datasets) [user@node folder]$ datasets download genome accession GCF_000009045.1
(ncbi-datasets) [user@node folder]$ unzip ncbi_dataset.zip
(ncbi-datasets) [user@node folder]$ ll
total 2.4M
-rw-r----- 1 user group 4.1M May 22  2016 GCA_000009045.1_ASM904v1_genomic.fna
-rw------- 1 user group 1.6K May 13 22:54 README.md
-rw-r----- 1 user group 1.2M May 14 05:54 ncbi_dataset.zip
drwxr-x--- 3 user group 4.0K May 14 05:55 ncbi_dataset
(ncbi-datasets) [user@node folder]$ ll ncbi_dataset/data/GCF_000009045.1
total 4176
-rw------- 1 user group 4.1M May 13 22:54 GCF_000009045.1_ASM904v1_genomic.fna
(ncbi-datasets) [user@node folder]$ umask
0027

Expected behavior
Expect the file permissions to be the default of the user (umask 0027 in this case). In this specific case, importantly, this will give others users of the group access to the file.

Thank you

@joegeorgeson joegeorgeson added the bug Something isn't working label May 14, 2024
@ericcox1
Copy link
Collaborator

Hi @joegeorgeson,

Thanks for opening this issue. We're going to look into matching the file permissions to the user default permissions.

Best,
Eric

Eric Cox, PhD [Contractor] (he/him/his)
NCBI Datasets
NIH/NLM/NCBI
eric.cox@nih.gov

@syntheticgio
Copy link

Hi @joegeorgeson ,

Just wanted to follow up on this report. My understanding is that you would like the files extracted from the zip file to match these permissions (not specifically the zip file itself). The zip utility on Linux unfortunately doesn't seem to support this from our research. Files extracted from a zip file will have the same permissions that they were given when put into the zip file. In particular the umask value on Linux is not respected. We do control our file permissions inside the archive and so we could give group or all permissions to the files when they are extracted, but this would be in all cases. It would not follow the users permissions.

Hopefully this addresses your question. I'm going to close the ticket, but feel free to reopen and clarify if I've misunderstood your request.

Best,
John

@syntheticgio syntheticgio closed this as not planned Won't fix, can't repro, duplicate, stale Jan 3, 2025
@joegeorgeson
Copy link
Author

Thanks for the reply and explanation John, nothing further needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants