* tests/cp/preserve-gid: Expect a cp-without-`-p'-created file to
have a group ID of $(id -g). Reported by Jarod Wilson. Details in
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13803/focus=13837
. $srcdir/test-lib.sh
require_root_
+# Record primary group number, usually 0.
+# This is the group ID used when cp (without -p) creates a new file.
+primary_group_num=$(id -g)
+
create() {
echo "$1" > "$1" || exit 1
chown "+$2:+$3" "$1" || exit 1
if test "x$s" != "x$u $g"; then
# Allow the actual group to match that of the parent directory
# (it was set to 0 above).
- if test "x$s" = "x$u 0"; then
+ if test "x$s" = "x$u $primary_group_num"; then
:
else
echo "$0: $* $f b: $u $g != $s" 1>&2