JuliaIO / Tar.jl

TAR files: create, list, extract them in pure Julia
MIT License
79 stars 19 forks source link

permission docs are inaccurate #38

Closed StefanKarpinski closed 3 years ago

StefanKarpinski commented 4 years ago

The section https://github.com/JuliaIO/Tar.jl#permissions is wrong for extraction: contrary to what is claimed, extraction of a tarball tries to apply the exact mode recorded in the tarball to the extracted file. Need to decide wether to fix the docs or the implementation. cc @staticfloat since we have encountered cases where extracting read-only files causes issues, but also there may be cases where artifacts depend on some files being read-only.

staticfloat commented 4 years ago

IMO, Tar.jl should just use the permissions within the tarball.

StefanKarpinski commented 4 years ago

Ok—that's what it actually does, so this would just be a documentation fix.

StefanKarpinski commented 4 years ago

Looking at the extract code again, I realize that the docs were correct before: we only respect the user executable bit on files, which is how git behaves. I should revert the doc change that "fixed" this.

ViralBShah commented 3 years ago

It seems that on MacOS, Tar.jl does not use the same permissions as within the tarball in some cases.

See the discussion in https://github.com/JuliaPackaging/Yggdrasil/pull/2231 and https://github.com/JuliaPackaging/Yggdrasil/issues/1969. I run into this issue with Qt_jll, but only on macOS.

StefanKarpinski commented 3 years ago

This was fixed already — it was because Sys.isexecutable is not reliable on macOS. So we only use it on Windows and use filemode everywhere else; or, since https://github.com/JuliaIO/Tar.jl/commit/0ba9683b202f09fe13b18368d6f6f20eca500c92 we actually just unconditionally call chmod to set the permissions to what we want.

StefanKarpinski commented 3 years ago

Accurate now (and changed)