datasets icon indicating copy to clipboard operation
datasets copied to clipboard

Permissions of download not default of user

Open joegeorgeson opened this issue 1 year ago • 1 comments

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 avatar May 14 '24 03:05 joegeorgeson

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 [email protected]

ericcox1 avatar May 14 '24 14:05 ericcox1

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 avatar Jan 03 '25 18:01 syntheticgio

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

joegeorgeson avatar Jan 04 '25 21:01 joegeorgeson