Skip to content

tests/cp/preserve-gid: cp -p fails to preserve group #8452

@drinkcat

Description

@drinkcat

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions