uutils / uutils/coreutils

tests/cp/preserve-gid: `cp -p` fails to preserve group

Open
#8,452 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

U - cp
Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

Looks like I didn't fix everything in #8380...

Steps (assumes users/groups 1002/1003/1004 don't exist):

mkdir t
chmod a+rwx t
touch t/b1 && sudo chown 1002:1004 t/b1
rm -f t/b
sudo chroot --skip-chdir --user=+1002:+1003 --groups=+1003,+1004 / cp -p t/b1 t/b
ls -l t
total 0
-rw-r--r-- 1 1002 1004 0 Aug  8 18:33 b
-rw-r--r-- 1 1002 1004 0 Aug  8 18:33 b1
rm -f t/b
sudo chroot --skip-chdir --user=+1002:+1003 --groups=+1003,+1004 / target/debug/cp -p t/b1 t/b
ls -l t
total 0
-rw-r--r-- 1 1002 1003 0 Aug  8 18:37 b
-rw-r--r-- 1 1002 1004 0 Aug  8 18:33 b1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tests/cp/preserve-gid and reproduce the two cp -p commands using the users and groups described in the issue. Compare the resulting ownership of t/b with t/b1; done means the test demonstrates that cp -p preserves group 1004 in the chroot scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.