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

Single files lose their file modes #148

Closed
mxey opened this issue Jan 20, 2020 · 5 comments
Closed

Single files lose their file modes #148

mxey opened this issue Jan 20, 2020 · 5 comments
Assignees
Labels
stale Inactive issues or pull requests

Comments

@mxey
Copy link
Contributor

mxey commented Jan 20, 2020

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.

@SteveLasker
Copy link
Contributor

Hi @mxey
Can you provide a repro? Is this with the ORAS client, or using the ORAS libraries?

@mxey
Copy link
Contributor Author

mxey commented Sep 14, 2020

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.

@Hades32
Copy link

Hades32 commented Jun 8, 2021

Noticed this as well. Is that expected @SteveLasker ?

@SteveLasker
Copy link
Contributor

@deitch, @jdolitsky, @shizhMSFT can you help with some thoughts?
This looks like the work to standardize around tar would be really helpful. #178

@shizhMSFT shizhMSFT added this to the future milestone May 7, 2022
@yizha1 yizha1 removed this from the future milestone Aug 31, 2022
@shizhMSFT shizhMSFT added the stale Inactive issues or pull requests label Mar 22, 2023
@shizhMSFT
Copy link
Contributor

Closing this issue due to inactivity. Please re-open if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Inactive issues or pull requests
Projects
No open projects
Status: No status
Development

No branches or pull requests

6 participants