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

cp -a does not copy attributes (owner, rights) of directories #6875

Open
vadimcojuhar opened this issue Nov 19, 2024 · 1 comment · May be fixed by #6884
Open

cp -a does not copy attributes (owner, rights) of directories #6875

vadimcojuhar opened this issue Nov 19, 2024 · 1 comment · May be fixed by #6884
Labels

Comments

@vadimcojuhar
Copy link

When copying directories from one to another with the -a option, only file attributes are copied, attributes of subdirectories are ignored.

Tested in Alpine Linux 3.20 with uutils 0.0.28.

Below is an example:

/ # ls -l /bin/cp 
lrwxrwxrwx 1 root root 17 Nov 19 10:17 /bin/cp -> ../usr/bin/uutils
/ # cp --version
cp 0.0.28
/ # mkdir -p /app/folder1
/ # echo test > /app/file1
/ # echo test > /app/folder1/file1
/ # chown -R nobody:nobody /app
/ # ls -l /app/
total 4
-rw-r--r-- 1 nobody nobody  5 Nov 19 10:20 file1
drwxr-xr-x 2 nobody nobody 19 Nov 19 10:20 folder1
/ # ls -l /app/file1 
-rw-r--r-- 1 nobody nobody 5 Nov 19 10:20 /app/file1
/ # mkdir /app-copy
/ # cp -a /app/. /app-copy
/ # ls -l /app-copy/
total 4
-rw-r--r-- 1 nobody nobody  5 Nov 19 10:20 file1
drwx------ 2 root   root   19 Nov 19 10:22 folder1
/ # ls -l /app-copy/folder1/
total 4
-rw-r--r-- 1 nobody nobody 5 Nov 19 10:20 file1
@rm-dr
Copy link

rm-dr commented Nov 23, 2024

Yep, I can reproduce this on current main. Starting on a pr.

@rm-dr rm-dr linked a pull request Nov 23, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants