summaryrefslogtreecommitdiff
path: root/tests/cp/preserve-gid.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cp/preserve-gid.sh')
-rwxr-xr-xtests/cp/preserve-gid.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/cp/preserve-gid.sh b/tests/cp/preserve-gid.sh
index 0a0bacdd..f141ac14 100755
--- a/tests/cp/preserve-gid.sh
+++ b/tests/cp/preserve-gid.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Verify that cp -p preserves GID when it is possible.
-# Copyright (C) 2007-2013 Free Software Foundation, Inc.
+# Copyright (C) 2007-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -117,8 +117,9 @@ t1() {
u=$1; shift
g=$1; shift
t0 "$f" "$u" "$g" \
- setuidgid -g "$nameless_gid1,$nameless_gid2" \
- "$nameless_uid" env PATH="$tmp_path" "$@"
+ chroot --user=+$nameless_uid:+$nameless_gid1 \
+ --groups="+$nameless_gid1,+$nameless_gid2" \
+ / env PATH="$tmp_path" "$@"
}
t1 a0 "$nameless_uid" "$nameless_gid1" cp