oras
oras copied to clipboard
Single files lose their file modes
When adding a directory to a FileStore, it creates a tarball, which means various file modes are stored and later restored on pull. But when adding a single file, the file modes are lost. This was quite confusing to me and IMO both should behave the same.
Hi @mxey Can you provide a repro? Is this with the ORAS client, or using the ORAS libraries?
oras version:
Version: 0.8.1
Go version: go1.12.4
Git commit: 237ac925cb6a308a5523cc048292bb53037f6975
Git tree state: clean
OS: macOS 10.15.6 (19G2021)
Start local Docker registry:
docker run -d -p 5000:5000 --restart=always --name registry registry:2
Prepare input files:
mkdir -p oras-repro
cd oras-repro
touch file.txt
mkdir directory
touch directory/fileindir.txt
chmod 400 file.txt directory/fileindir.txt
Check permissions with ls -l file.txt directory/fileindir.txt
:
-r-------- 1 Max staff 0 14 Sep 13:09 directory/fileindir.txt
-r-------- 1 Max staff 0 14 Sep 13:09 file.txt
Push and pull:
oras push localhost:5000/repro:latest file.txt directory
oras pull localhost:5000/repro:latest --output=$PWD/out
Check permissions with cd out && ls -l file.txt directory/fileindir.txt
:
-r-------- 1 Max staff 0 14 Sep 13:09 directory/fileindir.txt
-rw-r--r-- 1 Max staff 0 14 Sep 13:10 file.txt
As you can see, the file in the directory retained its permissions of 0400, but the other file did not.
Noticed this as well. Is that expected @SteveLasker ?
@deitch, @jdolitsky, @shizhMSFT can you help with some thoughts? This looks like the work to standardize around tar would be really helpful. https://github.com/oras-project/oras/issues/178
Closing this issue due to inactivity. Please re-open if needed.