Re: new snapshot [Re: coreutils 6.9.92 fail to configure on *bsd
On Sat, Jan 26, 2008 at 08:58:34AM +0100, Jim Meyering wrote: Please do this as root: cd coreutils-6.10/src ./id -a ./rm -rf f g echo a f ./chown +0:+0 f ls -ld . f ./cp f g ls -l g and look at the output. The final ls should show g with group root. For some reason it doesn't. # cd coreutils-6.10/src # ./id -a uid=0(root) gid=0(wheel) groups=0(wheel),1(daemon),8(procview), 2(kmem),29(certusers),3(sys),9(procmod),4(tty), 102(com.apple.sharepoint.group.2),5(operator),80(admin),20(staff), 101(com.apple.sharepoint.group.1) # ./rm -rf f g # echo a f # ./chown +0:+0 f # ls -ld . f drwxr-xr-x 3 pipping staff 11186 Jan 26 12:29 . -rw-r--r-- 1 root wheel 2 Jan 26 12:29 f # ./cp f g # ls -l g -rw-r--r-- 1 root staff 2 Jan 26 12:29 g # ( exactly the same happens when the bsd tools in /usr/bin and /bin are used instead btw ) If not, please repeat but with this in place of the ./cp command above: strace -o log ./cp f g and then send the output as well as the contents of log to the list. Sorry, but there's no strace on darwin9. -- Elias pgpKTuCR23QqD.pgp Description: PGP signature ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: new snapshot [Re: coreutils 6.9.92 fail to configure on *bsd
Elias Pipping [EMAIL PROTECTED] wrote: On Sat, Jan 26, 2008 at 08:58:34AM +0100, Jim Meyering wrote: Please do this as root: cd coreutils-6.10/src ./id -a ./rm -rf f g echo a f ./chown +0:+0 f ls -ld . f ./cp f g ls -l g and look at the output. The final ls should show g with group root. For some reason it doesn't. # cd coreutils-6.10/src # ./id -a uid=0(root) gid=0(wheel) groups=0(wheel),1(daemon),8(procview), 2(kmem),29(certusers),3(sys),9(procmod),4(tty), 102(com.apple.sharepoint.group.2),5(operator),80(admin),20(staff), 101(com.apple.sharepoint.group.1) # ./rm -rf f g # echo a f # ./chown +0:+0 f # ls -ld . f drwxr-xr-x 3 pipping staff 11186 Jan 26 12:29 . -rw-r--r-- 1 root wheel 2 Jan 26 12:29 f # ./cp f g # ls -l g -rw-r--r-- 1 root staff 2 Jan 26 12:29 g That suggests that the bogus group is set by cp's open call. I suspect some sort of ACL mechanism that specifies staff as the default group -- or maybe some rule says inherit group from parent directory. Do you see the same behavior if you run those commands in /tmp? (in place of ./, you'll need /abs/path-to/coreutils-6.10/src/) ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: new snapshot [Re: coreutils 6.9.92 fail to configure on *bsd
On Sat, Jan 26, 2008 at 02:19:12PM +0100, Andreas Schwab wrote: Elias Pipping [EMAIL PROTECTED] writes: Sorry, but there's no strace on darwin9. The darwin equivalent appears to be ktrace. Indeed. While ktrace came with darwin8, it no longer comes with darwin9, though. -- Elias pgpur5peCqHZx.pgp Description: PGP signature ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: new snapshot [Re: coreutils 6.9.92 fail to configure on *bsd
On Sat, Jan 26, 2008 at 01:54:58PM +0100, Jim Meyering wrote: Elias Pipping [EMAIL PROTECTED] wrote: # ls -ld . f drwxr-xr-x 3 pipping staff 11186 Jan 26 12:29 . -rw-r--r-- 1 root wheel 2 Jan 26 12:29 f # ./cp f g # ls -l g -rw-r--r-- 1 root staff 2 Jan 26 12:29 g That suggests that the bogus group is set by cp's open call. I suspect some sort of ACL mechanism that specifies staff as the default group -- or maybe some rule says inherit group from parent directory. The latter seems to be the case. Do you see the same behavior if you run those commands in /tmp? (in place of ./, you'll need /abs/path-to/coreutils-6.10/src/) # pwd /tmp # /Users/pipping/coreutils-6.10/src/id -a uid=0(root) gid=0(wheel) groups=0(wheel),1(daemon),8(procview), 2(kmem),29(certusers),3(sys),9(procmod),4(tty), 102(com.apple.sharepoint.group.2),5(operator),80(admin),20(staff), 101(com.apple.sharepoint.group.1) # /Users/pipping/coreutils-6.10/src/rm -rf f g # echo a f # /Users/pipping/coreutils-6.10/src/chown +0:+0 f # ls -ld . f drwxrwxrwt 9 root wheel 374 Jan 26 15:10 . -rw-r--r-- 1 root wheel2 Jan 26 15:10 f # /Users/pipping/coreutils-6.10/src/cp f g # ls -l g -rw-r--r-- 1 root wheel 2 Jan 26 15:11 g # -- Elias pgp68V1XRsGXv.pgp Description: PGP signature ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: new snapshot [Re: coreutils 6.9.92 fail to configure on *bsd
Elias Pipping [EMAIL PROTECTED] wrote: On Sat, Jan 26, 2008 at 01:54:58PM +0100, Jim Meyering wrote: Elias Pipping [EMAIL PROTECTED] wrote: # ls -ld . f drwxr-xr-x 3 pipping staff 11186 Jan 26 12:29 . -rw-r--r-- 1 root wheel 2 Jan 26 12:29 f # ./cp f g # ls -l g -rw-r--r-- 1 root staff 2 Jan 26 12:29 g That suggests that the bogus group is set by cp's open call. I suspect some sort of ACL mechanism that specifies staff as the default group -- or maybe some rule says inherit group from parent directory. The latter seems to be the case. It does, indeed. Please see if this makes the test pass: Avoid cp/preserve-gid test failure on Mac OS 10.5.1 (Darwin 9.1) * tests/cp/preserve-gid: Set group as well as owner on .. Reported by Elias Pipping. diff --git a/tests/cp/preserve-gid b/tests/cp/preserve-gid index 5f2c050..9537dc0 100755 --- a/tests/cp/preserve-gid +++ b/tests/cp/preserve-gid @@ -1,7 +1,7 @@ #!/bin/sh # Verify that cp -p preserves GID when it is possible. -# Copyright (C) 2007 Free Software Foundation, Inc. +# Copyright (C) 2007, 2008 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 @@ -61,7 +61,7 @@ if test -z $nameless_uid \ skip_test_ couldn't find a nameless UID or GID fi -chown +$nameless_uid . +chown +$nameless_uid:+0 . create a0 0 0 create b0 $nameless_uid $nameless_gid1 ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: new snapshot [Re: coreutils 6.9.92 fail to configure on *bsd
On Sat, Jan 26, 2008 at 03:36:23PM +0100, Jim Meyering wrote: Please see if this makes the test pass: Avoid cp/preserve-gid test failure on Mac OS 10.5.1 (Darwin 9.1) * tests/cp/preserve-gid: Set group as well as owner on .. Reported by Elias Pipping. diff --git a/tests/cp/preserve-gid b/tests/cp/preserve-gid index 5f2c050..9537dc0 100755 --- a/tests/cp/preserve-gid +++ b/tests/cp/preserve-gid @@ -1,7 +1,7 @@ #!/bin/sh # Verify that cp -p preserves GID when it is possible. -# Copyright (C) 2007 Free Software Foundation, Inc. +# Copyright (C) 2007, 2008 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 @@ -61,7 +61,7 @@ if test -z $nameless_uid \ skip_test_ couldn't find a nameless UID or GID fi -chown +$nameless_uid . +chown +$nameless_uid:+0 . create a0 0 0 create b0 $nameless_uid $nameless_gid1 The test still fails, but it gets a whole lot further :D -- Elias % tar xf coreutils-6.10.tar % cd coreutils-6.10 % patch -p1 ~/foo2.patch patching file tests/cp/preserve-gid % ./configure --disable-acl /dev/null % make -j3 /dev/null % sudo env VERBOSE=yes NON_ROOT_USERNAME=$USER make check -C tests/cp TESTS=preserve-gid make check-TESTS FAIL: preserve-gid.log === 1 of 1 tests failed See tests/cp/test-suite.log Please report it to bug-coreutils@gnu.org === = GNU coreutils 6.10: tests/cp/test-suite.log = 1 of 1 tests failed. .. contents:: :depth: 2 FAIL: preserve-gid.log (exit: 1) + cp --version cp (GNU coreutils) 6.10 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Torbjorn Granlund, David MacKenzie, and Jim Meyering. ++ perl -le 'foreach my $i (1000..16*1024-1) { getpwuid $i or (print $i), exit }' + nameless_uid=1000 ++ perl -le 'foreach my $i (1000..16*1024) { getgrgid $i or (print $i), exit }' + nameless_gid1=1000 ++ perl -le 'foreach my $i (1000+1..16*1024) { getgrgid $i or (print $i), exit }' + nameless_gid2=1001 + test -z 1000 + test -z 1000 + test -z 1001 + chown +1000:+0 . + create a0 0 0 + echo a0 + chown +0:+0 a0 + create b0 1000 1000 + echo b0 + chown +1000:+1000 b0 + create b1 1000 1001 + echo b1 + chown +1000:+1001 b1 + create c0 0 1000 + echo c0 + chown +0:+1000 c0 + create c1 0 1001 + echo c1 + chown +0:+1001 c1 + t0 a0 0 0 cp + f=a0 + shift + u=0 + shift + g=0 + shift + rm -f b + cp a0 b ++ stat -c '%u %g' b + s='0 0' + test 'x0 0' '!=' 'x0 0' + t0 b0 0 0 cp + f=b0 + shift + u=0 + shift + g=0 + shift + rm -f b + cp b0 b ++ stat -c '%u %g' b + s='0 0' + test 'x0 0' '!=' 'x0 0' + t0 b1 0 0 cp + f=b1 + shift + u=0 + shift + g=0 + shift + rm -f b + cp b1 b ++ stat -c '%u %g' b + s='0 0' + test 'x0 0' '!=' 'x0 0' + t0 c0 0 0 cp + f=c0 + shift + u=0 + shift + g=0 + shift + rm -f b + cp c0 b ++ stat -c '%u %g' b + s='0 0' + test 'x0 0' '!=' 'x0 0' + t0 c1 0 0 cp + f=c1 + shift + u=0 + shift + g=0 + shift + rm -f b + cp c1 b ++ stat -c '%u %g' b + s='0 0' + test 'x0 0' '!=' 'x0 0' + t0 a0 0 0 cp -p + f=a0 + shift + u=0 + shift + g=0 + shift + rm -f b + cp -p a0 b ++ stat -c '%u %g' b + s='0 0' + test 'x0 0' '!=' 'x0 0' + t0 b0 1000 1000 cp -p + f=b0 + shift + u=1000 + shift + g=1000 + shift + rm -f b + cp -p b0 b ++ stat -c '%u %g' b + s='1000 1000' + test 'x1000 1000' '!=' 'x1000 1000' + t0 b1 1000 1001 cp -p + f=b1 + shift + u=1000 + shift + g=1001 + shift + rm -f b + cp -p b1 b ++ stat -c '%u %g' b + s='1000 1001' + test 'x1000 1001' '!=' 'x1000 1001' + t0 c0 0 1000 cp -p + f=c0 + shift + u=0 + shift + g=1000 + shift + rm -f b + cp -p c0 b ++ stat -c '%u %g' b + s='0 1000' + test 'x0 1000' '!=' 'x0 1000' + t0 c1 0 1001 cp -p + f=c1 + shift + u=0 + shift + g=1001 + shift + rm -f b + cp -p c1 b ++ stat -c '%u %g' b + s='0 1001' + test 'x0 1001' '!=' 'x0 1001' + t1 a0 1000 1000 cp + f=a0 + shift + u=1000 + shift + g=1000 + shift + t0 a0 1000 1000 setuidgid -g 1000,1001 1000 cp + f=a0 + shift + u=1000 + shift + g=1000 + shift + rm -f b + setuidgid -g 1000,1001 1000 cp a0 b ++ stat -c '%u %g' b + s='1000 0' + test 'x1000 0' '!=' 'x1000 1000' + echo './preserve-gid: setuidgid -g 1000,1001 1000 cp a0 b: 1000 1000 != 1000 0' ./preserve-gid: setuidgid -g 1000,1001 1000 cp a0 b: 1000 1000 != 1000 0 + exit 1 + exit 1 + st=1 + cleanup_ + : + d=/Users/pipping/coreutils-6.10/tests/cp/cu-preserve-gid.Z97dkWMGjs + cd /Users/pipping/coreutils-6.10/tests/cp + chmod -R u+rwx /Users/pipping/coreutils-6.10/tests/cp/cu-preserve-gid.Z97dkWMGjs + rm -rf
Re: new snapshot [Re: coreutils 6.9.92 fail to configure on *bsd
Elias Pipping [EMAIL PROTECTED] wrote: On Sat, Jan 26, 2008 at 03:36:23PM +0100, Jim Meyering wrote: Please see if this makes the test pass: Avoid cp/preserve-gid test failure on Mac OS 10.5.1 (Darwin 9.1) * tests/cp/preserve-gid: Set group as well as owner on .. Reported by Elias Pipping. diff --git a/tests/cp/preserve-gid b/tests/cp/preserve-gid index 5f2c050..9537dc0 100755 --- a/tests/cp/preserve-gid +++ b/tests/cp/preserve-gid @@ -1,7 +1,7 @@ #!/bin/sh # Verify that cp -p preserves GID when it is possible. -# Copyright (C) 2007 Free Software Foundation, Inc. +# Copyright (C) 2007, 2008 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 @@ -61,7 +61,7 @@ if test -z $nameless_uid \ skip_test_ couldn't find a nameless UID or GID fi -chown +$nameless_uid . +chown +$nameless_uid:+0 . create a0 0 0 create b0 $nameless_uid $nameless_gid1 The test still fails, but it gets a whole lot further :D Good. Progress :) Here's an additional patch that should get us past the latest failure. diff --git a/tests/cp/preserve-gid b/tests/cp/preserve-gid index 9537dc0..15bb51c 100755 --- a/tests/cp/preserve-gid +++ b/tests/cp/preserve-gid @@ -33,8 +33,14 @@ t0() { $@ $f b || exit 1 s=`stat -c '%u %g' b` if test x$s != x$u $g; then -echo $0: $* $f b: $u $g != $s 12 -(exit 1); exit 1 +# Allow the actual group to match that of the parent (set to 0 above) +# if the command was cp. +if test $@:$s = cp:$u 0; then + : +else + echo $0: $* $f b: $u $g != $s 12 + (exit 1); exit 1 +fi fi } ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: new snapshot [Re: coreutils 6.9.92 fail to configure on *bsd
On Sat, Jan 26, 2008 at 05:34:17PM +0100, Jim Meyering wrote: Here's an additional patch that should get us past the latest failure. Unfortunately, it doesn't. diff --git a/tests/cp/preserve-gid b/tests/cp/preserve-gid index 9537dc0..15bb51c 100755 --- a/tests/cp/preserve-gid +++ b/tests/cp/preserve-gid @@ -33,8 +33,14 @@ t0() { $@ $f b || exit 1 s=`stat -c '%u %g' b` if test x$s != x$u $g; then -echo $0: $* $f b: $u $g != $s 12 -(exit 1); exit 1 +# Allow the actual group to match that of the parent (set to 0 above) +# if the command was cp. +if test $@:$s = cp:$u 0; then + : +else + echo $0: $* $f b: $u $g != $s 12 + (exit 1); exit 1 +fi fi } -- Elias % tar xf coreutils-6.10.tar % cd coreutils-6.10 % patch -p1 ~/foo2.patch patching file tests/cp/preserve-gid % patch -p1 ~/foo3.patch patching file tests/cp/preserve-gid % ./configure --disable-acl /dev/null % make -j3 /dev/null % sudo env VERBOSE=yes NON_ROOT_USERNAME=$USER make check -C tests/cp TESTS=preserve-gid make check-TESTS FAIL: preserve-gid.log === 1 of 1 tests failed See tests/cp/test-suite.log Please report it to bug-coreutils@gnu.org === = GNU coreutils 6.10: tests/cp/test-suite.log = 1 of 1 tests failed. .. contents:: :depth: 2 FAIL: preserve-gid.log (exit: 1) + cp --version cp (GNU coreutils) 6.10 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Torbjorn Granlund, David MacKenzie, and Jim Meyering. ++ perl -le 'foreach my $i (1000..16*1024-1) { getpwuid $i or (print $i), exit }' + nameless_uid=1000 ++ perl -le 'foreach my $i (1000..16*1024) { getgrgid $i or (print $i), exit }' + nameless_gid1=1000 ++ perl -le 'foreach my $i (1000+1..16*1024) { getgrgid $i or (print $i), exit }' + nameless_gid2=1001 + test -z 1000 + test -z 1000 + test -z 1001 + chown +1000:+0 . + create a0 0 0 + echo a0 + chown +0:+0 a0 + create b0 1000 1000 + echo b0 + chown +1000:+1000 b0 + create b1 1000 1001 + echo b1 + chown +1000:+1001 b1 + create c0 0 1000 + echo c0 + chown +0:+1000 c0 + create c1 0 1001 + echo c1 + chown +0:+1001 c1 + t0 a0 0 0 cp + f=a0 + shift + u=0 + shift + g=0 + shift + rm -f b + cp a0 b ++ stat -c '%u %g' b + s='0 0' + test 'x0 0' '!=' 'x0 0' + t0 b0 0 0 cp + f=b0 + shift + u=0 + shift + g=0 + shift + rm -f b + cp b0 b ++ stat -c '%u %g' b + s='0 0' + test 'x0 0' '!=' 'x0 0' + t0 b1 0 0 cp + f=b1 + shift + u=0 + shift + g=0 + shift + rm -f b + cp b1 b ++ stat -c '%u %g' b + s='0 0' + test 'x0 0' '!=' 'x0 0' + t0 c0 0 0 cp + f=c0 + shift + u=0 + shift + g=0 + shift + rm -f b + cp c0 b ++ stat -c '%u %g' b + s='0 0' + test 'x0 0' '!=' 'x0 0' + t0 c1 0 0 cp + f=c1 + shift + u=0 + shift + g=0 + shift + rm -f b + cp c1 b ++ stat -c '%u %g' b + s='0 0' + test 'x0 0' '!=' 'x0 0' + t0 a0 0 0 cp -p + f=a0 + shift + u=0 + shift + g=0 + shift + rm -f b + cp -p a0 b ++ stat -c '%u %g' b + s='0 0' + test 'x0 0' '!=' 'x0 0' + t0 b0 1000 1000 cp -p + f=b0 + shift + u=1000 + shift + g=1000 + shift + rm -f b + cp -p b0 b ++ stat -c '%u %g' b + s='1000 1000' + test 'x1000 1000' '!=' 'x1000 1000' + t0 b1 1000 1001 cp -p + f=b1 + shift + u=1000 + shift + g=1001 + shift + rm -f b + cp -p b1 b ++ stat -c '%u %g' b + s='1000 1001' + test 'x1000 1001' '!=' 'x1000 1001' + t0 c0 0 1000 cp -p + f=c0 + shift + u=0 + shift + g=1000 + shift + rm -f b + cp -p c0 b ++ stat -c '%u %g' b + s='0 1000' + test 'x0 1000' '!=' 'x0 1000' + t0 c1 0 1001 cp -p + f=c1 + shift + u=0 + shift + g=1001 + shift + rm -f b + cp -p c1 b ++ stat -c '%u %g' b + s='0 1001' + test 'x0 1001' '!=' 'x0 1001' + t1 a0 1000 1000 cp + f=a0 + shift + u=1000 + shift + g=1000 + shift + t0 a0 1000 1000 setuidgid -g 1000,1001 1000 cp + f=a0 + shift + u=1000 + shift + g=1000 + shift + rm -f b + setuidgid -g 1000,1001 1000 cp a0 b ++ stat -c '%u %g' b + s='1000 0' + test 'x1000 0' '!=' 'x1000 1000' + test 'setuidgid -g 1000,1001 1000 cp:1000 0' = 'cp:1000 0' + echo './preserve-gid: setuidgid -g 1000,1001 1000 cp a0 b: 1000 1000 != 1000 0' ./preserve-gid: setuidgid -g 1000,1001 1000 cp a0 b: 1000 1000 != 1000 0 + exit 1 + exit 1 + st=1 + cleanup_ + : + d=/Users/pipping/coreutils-6.10/tests/cp/cu-preserve-gid.cZqpAQhXfq + cd /Users/pipping/coreutils-6.10/tests/cp + chmod -R u+rwx /Users/pipping/coreutils-6.10/tests/cp/cu-preserve-gid.cZqpAQhXfq + rm -rf /Users/pipping/coreutils-6.10/tests/cp/cu-preserve-gid.cZqpAQhXfq + exit 1 make[2]: *** [test-suite.log] Error 1 make[1]: *** [check-TESTS] Error 2 make: *** [check-am] Error 2 % --- preserve-gid_test_new 2008-01-26 16:48:43 +0100 +++
Re: new snapshot [Re: coreutils 6.9.92 fail to configure on *bsd
Elias Pipping [EMAIL PROTECTED] wrote: On Sat, Jan 26, 2008 at 05:34:17PM +0100, Jim Meyering wrote: Here's an additional patch that should get us past the latest failure. Unfortunately, it doesn't. ... ++ stat -c '%u %g' b + s='1000 0' + test 'x1000 0' '!=' 'x1000 1000' + test 'setuidgid -g 1000,1001 1000 cp:1000 0' = 'cp:1000 0' + echo './preserve-gid: setuidgid -g 1000,1001 1000 cp a0 b: 1000 1000 != 1000 0' ./preserve-gid: setuidgid -g 1000,1001 1000 cp a0 b: 1000 1000 != 1000 0 But it came close :-) Thanks for the quick feedback. I should have matched the whole command, from setuidgid -g...cp, not just cp. Here's a better one: * tests/cp/preserve-gid: accommodate Darwin9 oddity. diff --git a/tests/cp/preserve-gid b/tests/cp/preserve-gid index 9537dc0..82ee861 100755 --- a/tests/cp/preserve-gid +++ b/tests/cp/preserve-gid @@ -33,8 +33,15 @@ t0() { $@ $f b || exit 1 s=`stat -c '%u %g' b` if test x$s != x$u $g; then -echo $0: $* $f b: $u $g != $s 12 -(exit 1); exit 1 +# Allow the actual group to match that of the parent directory +# (it was set to 0 above) if the command was cp. +case $@:$s in + * cp:$u 0) ;; + *) + echo $0: $* $f b: $u $g != $s 12 + (exit 1); exit 1 + ;; +esac fi } -- 1.5.4.rc4.26.g228a ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: new snapshot [Re: coreutils 6.9.92 fail to configure on *bsd
On Sat, Jan 26, 2008 at 07:06:58PM +0100, Jim Meyering wrote: Here's a better one: More progress! (still fails) * tests/cp/preserve-gid: accommodate Darwin9 oddity. diff --git a/tests/cp/preserve-gid b/tests/cp/preserve-gid index 9537dc0..82ee861 100755 --- a/tests/cp/preserve-gid +++ b/tests/cp/preserve-gid @@ -33,8 +33,15 @@ t0() { $@ $f b || exit 1 s=`stat -c '%u %g' b` if test x$s != x$u $g; then -echo $0: $* $f b: $u $g != $s 12 -(exit 1); exit 1 +# Allow the actual group to match that of the parent directory +# (it was set to 0 above) if the command was cp. +case $@:$s in + * cp:$u 0) ;; + *) + echo $0: $* $f b: $u $g != $s 12 + (exit 1); exit 1 + ;; +esac fi } -- 1.5.4.rc4.26.g228a -- Elias % tar xf coreutils-6.10.tar % cd coreutils-6.10 % patch -p1 ~/foo2.patch patching file tests/cp/preserve-gid % patch -p1 ~/foo3a.patch patching file tests/cp/preserve-gid % ./configure --disable-acl /dev/null % make -j3 /dev/null % sudo env VERBOSE=yes NON_ROOT_USERNAME=$USER make check -C tests/cp TESTS=preserve-gid make check-TESTS FAIL: preserve-gid.log === 1 of 1 tests failed See tests/cp/test-suite.log Please report it to bug-coreutils@gnu.org === = GNU coreutils 6.10: tests/cp/test-suite.log = 1 of 1 tests failed. .. contents:: :depth: 2 FAIL: preserve-gid.log (exit: 1) + cp --version cp (GNU coreutils) 6.10 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Torbjorn Granlund, David MacKenzie, and Jim Meyering. ++ perl -le 'foreach my $i (1000..16*1024-1) { getpwuid $i or (print $i), exit }' + nameless_uid=1000 ++ perl -le 'foreach my $i (1000..16*1024) { getgrgid $i or (print $i), exit }' + nameless_gid1=1000 ++ perl -le 'foreach my $i (1000+1..16*1024) { getgrgid $i or (print $i), exit }' + nameless_gid2=1001 + test -z 1000 + test -z 1000 + test -z 1001 + chown +1000:+0 . + create a0 0 0 + echo a0 + chown +0:+0 a0 + create b0 1000 1000 + echo b0 + chown +1000:+1000 b0 + create b1 1000 1001 + echo b1 + chown +1000:+1001 b1 + create c0 0 1000 + echo c0 + chown +0:+1000 c0 + create c1 0 1001 + echo c1 + chown +0:+1001 c1 + t0 a0 0 0 cp + f=a0 + shift + u=0 + shift + g=0 + shift + rm -f b + cp a0 b ++ stat -c '%u %g' b + s='0 0' + test 'x0 0' '!=' 'x0 0' + t0 b0 0 0 cp + f=b0 + shift + u=0 + shift + g=0 + shift + rm -f b + cp b0 b ++ stat -c '%u %g' b + s='0 0' + test 'x0 0' '!=' 'x0 0' + t0 b1 0 0 cp + f=b1 + shift + u=0 + shift + g=0 + shift + rm -f b + cp b1 b ++ stat -c '%u %g' b + s='0 0' + test 'x0 0' '!=' 'x0 0' + t0 c0 0 0 cp + f=c0 + shift + u=0 + shift + g=0 + shift + rm -f b + cp c0 b ++ stat -c '%u %g' b + s='0 0' + test 'x0 0' '!=' 'x0 0' + t0 c1 0 0 cp + f=c1 + shift + u=0 + shift + g=0 + shift + rm -f b + cp c1 b ++ stat -c '%u %g' b + s='0 0' + test 'x0 0' '!=' 'x0 0' + t0 a0 0 0 cp -p + f=a0 + shift + u=0 + shift + g=0 + shift + rm -f b + cp -p a0 b ++ stat -c '%u %g' b + s='0 0' + test 'x0 0' '!=' 'x0 0' + t0 b0 1000 1000 cp -p + f=b0 + shift + u=1000 + shift + g=1000 + shift + rm -f b + cp -p b0 b ++ stat -c '%u %g' b + s='1000 1000' + test 'x1000 1000' '!=' 'x1000 1000' + t0 b1 1000 1001 cp -p + f=b1 + shift + u=1000 + shift + g=1001 + shift + rm -f b + cp -p b1 b ++ stat -c '%u %g' b + s='1000 1001' + test 'x1000 1001' '!=' 'x1000 1001' + t0 c0 0 1000 cp -p + f=c0 + shift + u=0 + shift + g=1000 + shift + rm -f b + cp -p c0 b ++ stat -c '%u %g' b + s='0 1000' + test 'x0 1000' '!=' 'x0 1000' + t0 c1 0 1001 cp -p + f=c1 + shift + u=0 + shift + g=1001 + shift + rm -f b + cp -p c1 b ++ stat -c '%u %g' b + s='0 1001' + test 'x0 1001' '!=' 'x0 1001' + t1 a0 1000 1000 cp + f=a0 + shift + u=1000 + shift + g=1000 + shift + t0 a0 1000 1000 setuidgid -g 1000,1001 1000 cp + f=a0 + shift + u=1000 + shift + g=1000 + shift + rm -f b + setuidgid -g 1000,1001 1000 cp a0 b ++ stat -c '%u %g' b + s='1000 0' + test 'x1000 0' '!=' 'x1000 1000' + case $@:$s in + t1 b0 1000 1000 cp + f=b0 + shift + u=1000 + shift + g=1000 + shift + t0 b0 1000 1000 setuidgid -g 1000,1001 1000 cp + f=b0 + shift + u=1000 + shift + g=1000 + shift + rm -f b + setuidgid -g 1000,1001 1000 cp b0 b ++ stat -c '%u %g' b + s='1000 0' + test 'x1000 0' '!=' 'x1000 1000' + case $@:$s in + t1 b1 1000 1000 cp + f=b1 + shift + u=1000 + shift + g=1000 + shift + t0 b1 1000 1000 setuidgid -g 1000,1001 1000 cp + f=b1 + shift + u=1000 + shift + g=1000 + shift + rm -f b + setuidgid -g 1000,1001 1000 cp b1 b ++ stat -c '%u %g' b + s='1000 0' + test 'x1000 0' '!=' 'x1000 1000' + case $@:$s in + t1 c0 1000 1000 cp + f=c0 + shift
Re: new snapshot [Re: coreutils 6.9.92 fail to configure on *bsd
Elias Pipping [EMAIL PROTECTED] wrote: On Wed, Jan 23, 2008 at 01:40:22PM +0100, Jim Meyering wrote: If that's the problem, here's an untested fix: Unfortunately, that doesn't seem to help. Thanks for checking. That suggests there's a more fundamental problem. Please do this as root: cd coreutils-6.10/src ./id -a ./rm -rf f g echo a f ./chown +0:+0 f ls -ld . f ./cp f g ls -l g and look at the output. The final ls should show g with group root. If not, please repeat but with this in place of the ./cp command above: strace -o log ./cp f g and then send the output as well as the contents of log to the list. ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: new snapshot [Re: coreutils 6.9.92 fail to configure on *bsd
On Mon, Jan 21, 2008 at 08:46:30AM +0100, Jim Meyering wrote: Elias Pipping [EMAIL PROTECTED] wrote: as for the check-root tests: this one now passes: special-bits these fail: rm/fail-2eperm cp/preserve-gid touch/now-owned-by-other It looks like they're all due to the fact that you used NON_ROOT_USERNAME=nobody and nobody lacks access to required files. Can you run it again, as recommended in README i.e., using NON_ROOT_USERNAME=your_user_name (assuming the source tree belongs to your_user_name): D'oh -- should've read that. So, with 6.10 and --disable-acl, all of the non-root tests pass and a single root-only test fails: % tar xf coreutils-6.10.tar.gz % cd coreutils-6.10 % ./configure --disable-acl % make -j3 % sudo env VERBOSE=yes NON_ROOT_USERNAME=$USER make check -C tests/cp TESTS=preserve-gid make check-TESTS FAIL: preserve-gid.log === 1 of 1 tests failed See tests/cp/test-suite.log Please report it to bug-coreutils@gnu.org === = GNU coreutils 6.10: tests/cp/test-suite.log = 1 of 1 tests failed. .. contents:: :depth: 2 FAIL: preserve-gid.log (exit: 1) + cp --version cp (GNU coreutils) 6.10 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Torbjorn Granlund, David MacKenzie, and Jim Meyering. ++ perl -le 'foreach my $i (1000..16*1024-1) { getpwuid $i or (print $i), exit }' + nameless_uid=1000 ++ perl -le 'foreach my $i (1000..16*1024) { getgrgid $i or (print $i), exit }' + nameless_gid1=1000 ++ perl -le 'foreach my $i (1000+1..16*1024) { getgrgid $i or (print $i), exit }' + nameless_gid2=1001 + test -z 1000 + test -z 1000 + test -z 1001 + chown +1000 . + create a0 0 0 + echo a0 + chown +0:+0 a0 + create b0 1000 1000 + echo b0 + chown +1000:+1000 b0 + create b1 1000 1001 + echo b1 + chown +1000:+1001 b1 + create c0 0 1000 + echo c0 + chown +0:+1000 c0 + create c1 0 1001 + echo c1 + chown +0:+1001 c1 + t0 a0 0 0 cp + f=a0 + shift + u=0 + shift + g=0 + shift + rm -f b + cp a0 b ++ stat -c '%u %g' b + s='0 20' + test 'x0 20' '!=' 'x0 0' + echo './preserve-gid: cp a0 b: 0 0 != 0 20' ./preserve-gid: cp a0 b: 0 0 != 0 20 + exit 1 + exit 1 + st=1 + cleanup_ + : + d=/Users/pipping/coreutils-6.10/tests/cp/cu-preserve-gid.Vh5JhaeTrx + cd /Users/pipping/coreutils-6.10/tests/cp + chmod -R u+rwx /Users/pipping/coreutils-6.10/tests/cp/cu-preserve-gid.Vh5JhaeTrx + rm -rf /Users/pipping/coreutils-6.10/tests/cp/cu-preserve-gid.Vh5JhaeTrx + exit 1 make[2]: *** [test-suite.log] Error 1 make[1]: *** [check-TESTS] Error 2 make: *** [check-am] Error 2 % -- Elias PS: this is still on i386-apple-darwin9.1.0 pgpAnqhjNfpZV.pgp Description: PGP signature ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: new snapshot [Re: coreutils 6.9.92 fail to configure on *bsd
Elias Pipping [EMAIL PROTECTED] wrote: ... D'oh -- should've read that. So, with 6.10 and --disable-acl, all of the non-root tests pass and a single root-only test fails: % tar xf coreutils-6.10.tar.gz % cd coreutils-6.10 % ./configure --disable-acl % make -j3 % sudo env VERBOSE=yes NON_ROOT_USERNAME=$USER make check -C tests/cp TESTS=preserve-gid make check-TESTS FAIL: preserve-gid.log ... ++ stat -c '%u %g' b + s='0 20' + test 'x0 20' '!=' 'x0 0' + echo './preserve-gid: cp a0 b: 0 0 != 0 20' Thanks for the report and details. That's probably due to your running the root-only tests in a directory with the sticky set-GID bit set. If that's the problem, here's an untested fix: * tests/cp/preserve-gid: Skip this test when run in a setgid directory. Reported by Elias Pipping. diff --git a/tests/cp/preserve-gid b/tests/cp/preserve-gid index 5f2c050..e96a0bd 100755 --- a/tests/cp/preserve-gid +++ b/tests/cp/preserve-gid @@ -1,7 +1,7 @@ #!/bin/sh # Verify that cp -p preserves GID when it is possible. -# Copyright (C) 2007 Free Software Foundation, Inc. +# Copyright (C) 2007, 2008 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 @@ -20,6 +20,8 @@ PRIV_CHECK_ARG=require-root . $srcdir/../priv-check . $srcdir/../test-lib.sh +. $abs_top_srcdir/tests/setgid-check + create() { echo $1 $1 || exit 1 chown +$2:+$3 $1 || exit 1 ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: new snapshot [Re: coreutils 6.9.92 fail to configure on *bsd
On Wed, Jan 23, 2008 at 01:40:22PM +0100, Jim Meyering wrote: If that's the problem, here's an untested fix: Unfortunately, that doesn't seem to help. % tar xf coreutils-6.10.tar.gz % cd coreutils-6.10 % cat ~/foo.patch diff --git a/tests/cp/preserve-gid b/tests/cp/preserve-gid index 5f2c050..e96a0bd 100755 --- a/tests/cp/preserve-gid +++ b/tests/cp/preserve-gid @@ -1,7 +1,7 @@ #!/bin/sh # Verify that cp -p preserves GID when it is possible. -# Copyright (C) 2007 Free Software Foundation, Inc. +# Copyright (C) 2007, 2008 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 @@ -20,6 +20,8 @@ PRIV_CHECK_ARG=require-root . $srcdir/../priv-check . $srcdir/../test-lib.sh +. $abs_top_srcdir/tests/setgid-check + create() { echo $1 $1 || exit 1 chown +$2:+$3 $1 || exit 1 % patch -p1 ~/foo.patch patching file tests/cp/preserve-gid % ./configure --disable-acl % make -j3 % sudo env VERBOSE=yes NON_ROOT_USERNAME=$USER make check -C tests/cp TESTS=preserve-gid make check-TESTS FAIL: preserve-gid.log === 1 of 1 tests failed See tests/cp/test-suite.log Please report it to bug-coreutils@gnu.org === = GNU coreutils 6.10: tests/cp/test-suite.log = 1 of 1 tests failed. .. contents:: :depth: 2 FAIL: preserve-gid.log (exit: 1) + cp --version cp (GNU coreutils) 6.10 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Torbjorn Granlund, David MacKenzie, and Jim Meyering. ++ perl -le 'foreach my $i (1000..16*1024-1) { getpwuid $i or (print $i), exit }' + nameless_uid=1000 ++ perl -le 'foreach my $i (1000..16*1024) { getgrgid $i or (print $i), exit }' + nameless_gid1=1000 ++ perl -le 'foreach my $i (1000+1..16*1024) { getgrgid $i or (print $i), exit }' + nameless_gid2=1001 + test -z 1000 + test -z 1000 + test -z 1001 + chown +1000 . + create a0 0 0 + echo a0 + chown +0:+0 a0 + create b0 1000 1000 + echo b0 + chown +1000:+1000 b0 + create b1 1000 1001 + echo b1 + chown +1000:+1001 b1 + create c0 0 1000 + echo c0 + chown +0:+1000 c0 + create c1 0 1001 + echo c1 + chown +0:+1001 c1 + t0 a0 0 0 cp + f=a0 + shift + u=0 + shift + g=0 + shift + rm -f b + cp a0 b ++ stat -c '%u %g' b + s='0 20' + test 'x0 20' '!=' 'x0 0' + echo './preserve-gid: cp a0 b: 0 0 != 0 20' ./preserve-gid: cp a0 b: 0 0 != 0 20 + exit 1 + exit 1 + st=1 + cleanup_ + : + d=/Users/pipping/coreutils-6.10/tests/cp/cu-preserve-gid.qmKidiSEBi + cd /Users/pipping/coreutils-6.10/tests/cp + chmod -R u+rwx /Users/pipping/coreutils-6.10/tests/cp/cu-preserve-gid.qmKidiSEBi + rm -rf /Users/pipping/coreutils-6.10/tests/cp/cu-preserve-gid.qmKidiSEBi + exit 1 make[2]: *** [test-suite.log] Error 1 make[1]: *** [check-TESTS] Error 2 make: *** [check-am] Error 2 % -- Elias pgp0iKkxE1XA8.pgp Description: PGP signature ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: new snapshot [Re: coreutils 6.9.92 fail to configure on *bsd
Elias Pipping [EMAIL PROTECTED] wrote: On Thu, Jan 17, 2008 at 03:34:20PM +0100, Jim Meyering wrote: I've built a new snapshot: http://meyering.net/cu/coreutils-ss.tar.gz http://meyering.net/cu/coreutils-ss.tar.lzma http://meyering.net/cu/coreutils-ss.tar.gz.sig http://meyering.net/cu/coreutils-ss.tar.lzma.sig and confirmed that it fixes all of those problems on your i386-apple-darwin9.1.0 system, as long as you disable ACL support: ./configure --disable-acl The other two failures were fixed via changes in gnulib: FAIL: test-frexpl FAIL: test-printf-frexpl With the above snapshot and --disable-acl, all of the default tests, including those enabled via RUN_VERY_EXPENSIVE_TESTS pass. Thanks for testing it. as for the check-root tests: this one now passes: special-bits these fail: rm/fail-2eperm cp/preserve-gid touch/now-owned-by-other It looks like they're all due to the fact that you used NON_ROOT_USERNAME=nobody and nobody lacks access to required files. Can you run it again, as recommended in README i.e., using NON_ROOT_USERNAME=your_user_name (assuming the source tree belongs to your_user_name): ** Running tests as root: -- If you run the tests as root, note that a few of them create files and/or run programs as a non-root user, `nobody' by default. If you want to use some other non-root username, specify it via the NON_ROOT_USERNAME environment variable. Depending on the permissions with which the working directories have been created, using `nobody' may fail, because that user won't have the required read and write access to the build and test directories. I find that it is best to unpack and build as a non-privileged user, and then to run the following command as that user in order to run the privilege-requiring tests: sudo env NON_ROOT_USERNAME=$USER make -k check-root If you can run the tests as root, please do so and report any problems. We get much less test coverage in that mode, and it's arguably more important that these tools work well when run by root than when run by less privileged users. ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: new snapshot [Re: coreutils 6.9.92 fail to configure on *bsd
Elias Pipping [EMAIL PROTECTED] wrote: Indeed -- all of the above work now. I grew a little more adventurous and did a `make -j3 check`. tty-eof appears to be moody: % env VERBOSE=yes make -j3 check -C tests/misc TESTS=tty-eof [ works fives times in a row ] % env VERBOSE=yes make -j3 check -C tests/misc TESTS=tty-eof make check-TESTS FAIL: tty-eof.log === 1 of 1 tests failed See tests/misc/test-suite.log Please report it to bug-coreutils@gnu.org === = GNU coreutils 6.9.92.8-27d16: tests/misc/test-suite.log = 1 of 1 tests failed. .. contents:: :depth: 2 FAIL: tty-eof.log (exit: 1) === ... F: 1: ^D F: 1: ^D tty-eof: tac didn't exit after ^D from standard input F: 1: ^D ... make[2]: *** [test-suite.log] Error 1 make[1]: *** [check-TESTS] Error 2 make: *** [check-am] Error 2 Thanks for reporting that. Unfortunately, it's hard to reproduce and debug at the same time. And it rarely complains about the same program twice in a row, so I'm confident it's not a problem with the programs themselves. That test works often enough that I'm not yet tempted to remove it. ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils
Re: new snapshot [Re: coreutils 6.9.92 fail to configure on *bsd
On Thu, Jan 17, 2008 at 03:34:20PM +0100, Jim Meyering wrote: I've built a new snapshot: http://meyering.net/cu/coreutils-ss.tar.gz http://meyering.net/cu/coreutils-ss.tar.lzma http://meyering.net/cu/coreutils-ss.tar.gz.sig http://meyering.net/cu/coreutils-ss.tar.lzma.sig and confirmed that it fixes all of those problems on your i386-apple-darwin9.1.0 system, as long as you disable ACL support: ./configure --disable-acl The other two failures were fixed via changes in gnulib: FAIL: test-frexpl FAIL: test-printf-frexpl With the above snapshot and --disable-acl, all of the default tests, including those enabled via RUN_VERY_EXPENSIVE_TESTS pass. as for the check-root tests: this one now passes: special-bits these fail: rm/fail-2eperm cp/preserve-gid touch/now-owned-by-other I must've missed one of those in my previous report, sorry. -- Elias PS: as for the test failure with touch: does this make any sense? # env PATH=../../src:/usr/bin which touch ../../src/touch # ../../src/setuidgid nobody env PATH=../../src:/usr/bin which touch ../../src/touch # ../../src/setuidgid nobody env PATH=/Users/pipping/Desktop/coreutils-6.9.92/src:/usr/bin which touch /usr/bin/touch # pwd /Users/pipping/Desktop/coreutils-6.9.92/tests/touch # stat ../../src /Users/pipping/Desktop/coreutils-6.9.92/src 234881026 34001435 drwxr-xr-x 3 pipping staff 0 11152 Jan 17 18:42:14 2008 Jan 17 18:33:47 2008 Jan 17 18:33:47 2008 Jan 12 01:14:34 2008 4096 0 0 ../../src 234881026 34001435 drwxr-xr-x 3 pipping staff 0 11152 Jan 17 18:42:14 2008 Jan 17 18:33:47 2008 Jan 17 18:33:47 2008 Jan 12 01:14:34 2008 4096 0 0 /Users/pipping/Desktop/coreutils-6.9.92/src touch_now-owned-by-other.log.bz2 Description: Binary data cp_preserve-gid.log.bz2 Description: Binary data rm_fail-2eperm.log.bz2 Description: Binary data pgpW1H3bQRgPh.pgp Description: PGP signature ___ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils