Hugh Daniel
2006-Dec-15 22:15 UTC
BugReport: rsync fails it's own "regression" test "chmod-option"
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Recent versions of rsync have a "regression test" called
"chmod-option" that when run fails, this should be causing rsync to be
rejected as broken by all distros and sysadmins.
A bit of research show that no one has mentioned this test since it
was last worked on in late September, nor does it show up as a current
bug anywhere. The slightly amusing reason for this is that the test
is not run unless one is EUID==root, which in general anyone building
software should not be, and so everyone likely sees the SKIP'ed test
and ignores it.
Being foolish I happened to notice that the skipped tests wanted root
and decided to run the test suite ("make check") as root as the
software indicated it needed for a full test. When run as root the
"chmod-option" test allays fails, and fails across many versions of
Linux, RedHat-7.3, SuSE-10.0, Debian-Etch in the same way.
I suspect it's more likely a test failure then a code failure, but
it needs to be fixed just the same before folks like me (paranoid,
pedantic) will accept that the newer versions of rsync are safe and
secure (chmod DOES have security implications...) for deployment.
I append the entire output of "make check" after my sig. Just in
case anyone asks, I have no interest in joining any list or web-sites,
which is why this bug report is simple email.
Thanks for rsync, good luck!
||ugh Daniel
hugh@toad.com
"""
# make check
gcc -std=gnu99 -I. -I. -g -O2 -DHAVE_CONFIG_H -Wall -W -c tls.c -o tls.o
gcc -std=gnu99 -g -O2 -DHAVE_CONFIG_H -Wall -W -o tls tls.o syscall.o
lib/compat.o lib/snprintf.o lib/permstring.o -lpopt
gcc -std=gnu99 -I. -I. -g -O2 -DHAVE_CONFIG_H -Wall -W -c getgroups.c -o
getgroups.o
gcc -std=gnu99 -g -O2 -DHAVE_CONFIG_H -Wall -W -o getgroups getgroups.o -lpopt
gcc -std=gnu99 -I. -I. -g -O2 -DHAVE_CONFIG_H -Wall -W -c getfsdev.c -o
getfsdev.o
gcc -std=gnu99 -g -O2 -DHAVE_CONFIG_H -Wall -W -o getfsdev getfsdev.o -lpopt
gcc -std=gnu99 -I. -I. -g -O2 -DHAVE_CONFIG_H -Wall -W -c trimslash.c -o
trimslash.o
gcc -std=gnu99 -g -O2 -DHAVE_CONFIG_H -Wall -W -o trimslash trimslash.o
syscall.o lib/compat.o lib/snprintf.o -lpopt
gcc -std=gnu99 -I. -I. -g -O2 -DHAVE_CONFIG_H -Wall -W -c t_unsafe.c -o
t_unsafe.o
gcc -std=gnu99 -I. -I. -g -O2 -DHAVE_CONFIG_H -Wall -W -c t_stub.c -o t_stub.o
gcc -std=gnu99 -g -O2 -DHAVE_CONFIG_H -Wall -W -o t_unsafe t_unsafe.o syscall.o
util.o t_stub.o lib/compat.o lib/snprintf.o -lpopt
gcc -std=gnu99 -I. -I. -g -O2 -DHAVE_CONFIG_H -Wall -W -c wildtest.c -o
wildtest.o
gcc -std=gnu99 -g -O2 -DHAVE_CONFIG_H -Wall -W -o wildtest wildtest.o
lib/compat.o -lpopt
rsync_bin=`pwd`/rsync ./runtests.sh
===========================================================./runtests.sh running
in /usr/local/src/rsync-2.6.9
rsync_bin=/usr/local/src/rsync-2.6.9/rsync
srcdir=/usr/local/src/rsync-2.6.9
testuser=hugh
os=Linux far.toad.com 2.6.18 #1 PREEMPT Sat Sep 30 12:12:43 PDT 2006 i686
GNU/Linux
preserve_scratch=no
scratchbase=/usr/local/src/rsync-2.6.9/testtmp
PASS 00-hello
PASS backup
PASS batch-mode
PASS chgrp
PASS chmod-option
PASS chmod-temp-dir
PASS chmod
SKIP chown (Can't chown (probably need root))
PASS compare-dest
PASS daemon-gzip-download
PASS daemon-gzip-upload
PASS daemon
PASS delete
SKIP devices (Rsync won't copy devices unless we're root)
PASS dir-sgid
PASS duplicates
PASS exclude
PASS executability
PASS fuzzy
PASS hands
PASS hardlinks
PASS itemize
PASS longdir
PASS merge
PASS relative
SKIP ssh-basic (Skipping SSH tests because $rsync_enable_ssh_tests is not
set)
PASS symlink-ignore
PASS trimslash
PASS unsafe-byname
PASS unsafe-links
PASS wildmatch
- ------------------------------------------------------------
- ----- overall results:
28 passed
3 skipped
- ------------------------------------------------------------
overall result is 0
hugh@far $ so
.bashrc@far.toad.com
root@far # make check
rsync_bin=`pwd`/rsync ./runtests.sh
===========================================================./runtests.sh running
in /usr/local/src/rsync-2.6.9
rsync_bin=/usr/local/src/rsync-2.6.9/rsync
srcdir=/usr/local/src/rsync-2.6.9
testuser=root
os=Linux far.toad.com 2.6.18 #1 PREEMPT Sat Sep 30 12:12:43 PDT 2006 i686
GNU/Linux
preserve_scratch=no
scratchbase=/usr/local/src/rsync-2.6.9/testtmp
PASS 00-hello
PASS backup
PASS batch-mode
PASS chgrp
- ----- chmod-option log follows
Testing for symlinks using 'test -h'
Running: "/usr/local/src/rsync-2.6.9/rsync -avv
"/usr/local/src/rsync-2.6.9/testtmp.chmod-option/from/"
"/usr/local/src/rsync-2.6.9/testtmp.chmod-option/check/""
building file list ...
done
created directory /usr/local/src/rsync-2.6.9/testtmp.chmod-option/check
delta-transmission disabled for local transfer or --whole-file
./
name1
name2
dir1/
dir2/
total: matches=0 hash_hits=0 false_alarms=0 data=40
sent 260 bytes received 82 bytes 684.00 bytes/sec
total size is 40 speedup is 0.12
- -------------
check how the directory listings compare with diff:
- -------------
check how the files compare with diff:
- -------------
Running: "/usr/local/src/rsync-2.6.9/rsync -avv --chmod ug-s,a+rX,D+w
"/usr/local/src/rsync-2.6.9/testtmp.chmod-option/from/"
"/usr/local/src/rsync-2.6.9/testtmp.chmod-option/to/""
building file list ...
done
created directory /usr/local/src/rsync-2.6.9/testtmp.chmod-option/to
delta-transmission disabled for local transfer or --whole-file
./
name1
name2
dir1/
dir2/
total: matches=0 hash_hits=0 false_alarms=0 data=40
sent 256 bytes received 82 bytes 676.00 bytes/sec
total size is 40 speedup is 0.12
- -------------
check how the directory listings compare with diff:
- -------------
check how the files compare with diff:
- -------------
makepath /usr/local/src/rsync-2.6.9/testtmp.chmod-option/to
makepath /usr/local/src/rsync-2.6.9/testtmp.chmod-option/from/foo
Running: "/usr/local/src/rsync-2.6.9/rsync -avv
"/usr/local/src/rsync-2.6.9/testtmp.chmod-option/from/"
"/usr/local/src/rsync-2.6.9/testtmp.chmod-option/check/""
building file list ...
done
created directory /usr/local/src/rsync-2.6.9/testtmp.chmod-option/check
delta-transmission disabled for local transfer or --whole-file
./
bar
foo/
total: matches=0 hash_hits=0 false_alarms=0 data=0
sent 133 bytes received 54 bytes 374.00 bytes/sec
total size is 0 speedup is 0.00
- -------------
check how the directory listings compare with diff:
- -------------
check how the files compare with diff:
- -------------
Running: "/usr/local/src/rsync-2.6.9/rsync -avv --chmod=Fo-x
"/usr/local/src/rsync-2.6.9/testtmp.chmod-option/from/"
"/usr/local/src/rsync-2.6.9/testtmp.chmod-option/to/""
building file list ...
done
delta-transmission disabled for local transfer or --whole-file
bar
foo/
total: matches=0 hash_hits=0 false_alarms=0 data=0
sent 133 bytes received 54 bytes 374.00 bytes/sec
total size is 0 speedup is 0.00
- -------------
check how the directory listings compare with diff:
- -------------
check how the files compare with diff:
- -------------
building configuration
/usr/local/src/rsync-2.6.9/testtmp.chmod-option/test-rsyncd.conf
makepath /usr/local/src/rsync-2.6.9/testtmp.chmod-option/to
Running: "/usr/local/src/rsync-2.6.9/rsync -rtvv
"/usr/local/src/rsync-2.6.9/testtmp.chmod-option/from/"
localhost::test-incoming-chmod/"
Using RSYNC_CONNECT_PROG instead of opening tcp connection to localhost port 873
Running socket program: "/usr/local/src/rsync-2.6.9/rsync
--config=/usr/local/src/rsync-2.6.9/testtmp.chmod-option/test-rsyncd.conf
--daemon"
opening connection using --server -vvtr . test-incoming-chmod/
building file list ...
done
delta-transmission enabled
bar
foo/
total: matches=0 hash_hits=0 false_alarms=0 data=0
sent 108 bytes received 50 bytes 316.00 bytes/sec
total size is 0 speedup is 0.00
- -------------
check how the directory listings compare with diff:
- --- /usr/local/src/rsync-2.6.9/testtmp.chmod-option/ls-from 2006-12-15
13:16:54.000000000 -0800
+++ /usr/local/src/rsync-2.6.9/testtmp.chmod-option/ls-to 2006-12-15
13:16:54.000000000 -0800
@@ -1,3 +1,3 @@
drwxrwxr-x 0 0.10 3 2006-12-15 21:16:53 .
- --rw-rw-r-- 0 0.10 1 2006-12-15 21:16:53 ./bar
- -drwxrwxr-x 0 0.10 2 2006-12-15 21:16:53 ./foo
+-rw-rw-r-- 0 0.0 1 2006-12-15 21:16:53 ./bar
+drwxrwxr-x 0 0.0 2 2006-12-15 21:16:53 ./foo
- -------------
check how the files compare with diff:
- -------------
- ----- chmod-option log ends
- ----- chmod-option rsyncd.log follows
2006/12/15 13:16:53 [29160] connect from localhost.localdomain (127.0.0.1)
2006/12/15 13:16:53 [29160] rsync to test-incoming-chmod/ from
localhost.localdomain (127.0.0.1)
2006/12/15 13:16:53 [29160] receiving file list
2006/12/15 13:16:53 [29160] delta-transmission enabled
2006/12/15 13:16:53 [29160] >f+++++++ localhost.localdomain [127.0.0.1]
test-incoming-chmod () 0 bar
2006/12/15 13:16:53 [29160] cd+++++++ localhost.localdomain [127.0.0.1]
test-incoming-chmod () 4096 foo
2006/12/15 13:16:54 [29160] sent 109 bytes received 113 bytes total size 0
- ----- chmod-option rsyncd.log ends
FAIL chmod-option
PASS chmod-temp-dir
PASS chmod
PASS chown
PASS compare-dest
PASS daemon-gzip-download
PASS daemon-gzip-upload
PASS daemon
PASS delete
PASS devices
PASS dir-sgid
PASS duplicates
PASS exclude
PASS executability
PASS fuzzy
PASS hands
PASS hardlinks
PASS itemize
PASS longdir
PASS merge
PASS relative
SKIP ssh-basic (Skipping SSH tests because $rsync_enable_ssh_tests is not
set)
PASS symlink-ignore
PASS trimslash
PASS unsafe-byname
PASS unsafe-links
PASS wildmatch
- ------------------------------------------------------------
- ----- overall results:
29 passed
1 failed
1 skipped
- ------------------------------------------------------------
overall result is 1
make: *** [check] Error 1
# echo $?
2
#
"""
-----BEGIN PGP SIGNATURE-----
Comment: For the matching public key, finger the Reply-To: address.
iQCVAwUBRYMWz1ZpdJR7FBQRAQJWqQP+M1EET4Ox9TiGNVmRIY/Nc0QgdVu1kC9S
NoJKSEkHH85UgO6g2uJt6z+WhBn5EXoFWCtwXq1Jy5yvxE82pybymxmCBNu7o1QC
Y1nfRUBxvv6oia9BI0Y65nEGSVekttE7ptTQlg7dU6JGwZlytRJtZoJGHN3AgZE1
YgGoHdZ+Rwo=SfIi
-----END PGP SIGNATURE-----
Matt McCutchen
2006-Dec-16 00:11 UTC
BugReport: rsync fails it's own "regression" test "chmod-option"
On 12/15/06, Hugh Daniel <hugh@road.toad.com> wrote:> When run as root the > "chmod-option" test allays fails, and fails across many versions of > Linux, RedHat-7.3, SuSE-10.0, Debian-Etch in the same way. > [Matt snipped here and PGP-unescaped below] > drwxrwxr-x 0 0.10 3 2006-12-15 21:16:53 . > --rw-rw-r-- 0 0.10 1 2006-12-15 21:16:53 ./bar > -drwxrwxr-x 0 0.10 2 2006-12-15 21:16:53 ./foo > +-rw-rw-r-- 0 0.0 1 2006-12-15 21:16:53 ./bar > +drwxrwxr-x 0 0.0 2 2006-12-15 21:16:53 ./fooIndeed, the test is invalid. The trouble is that the test suite starts an rsync daemon, instructs it to use uid and gid 0, and expects files created by the test suite to have the same user/group owners as those created by the daemon. This expectation is valid for non-root users (because the daemon fails to change its uid and gid) and for root with a default group of root but not for root with a default group of wheel, as you saw. The fix is to tell the rsync daemon to run as the same uid and gid as the user invoking the testsuite. Wayne, a patch for the test is attached. Matt -------------- next part -------------- A non-text attachment was scrubbed... Name: testsuite-daemon-same-uid-gid.diff Type: text/x-patch Size: 505 bytes Desc: not available Url : http://lists.samba.org/archive/rsync/attachments/20061215/84534bcf/testsuite-daemon-same-uid-gid.bin
Wayne Davison
2006-Dec-16 08:01 UTC
BugReport: rsync fails it's own "regression" test "chmod-option"
On Fri, Dec 15, 2006 at 01:43:38PM -0800, Hugh Daniel wrote:> A bit of research show that no one has mentioned this test since it > was last worked on in late SeptemberThat's because the test works fine for most people. Apparently it only fails when someone runs as root with a non-zero default group (which doesn't seem to affect many people).> The slightly amusing reason for this is that the test is not run > unless one is EUID==rootNo, that test runs fine as a normal user. It is other tests that say they are being skipped due to not being root. The root-required tests will also succeed if the fakeroot command is around (the test code uses fakeroot for just the tests that need it without you having to do anything special). Thus, on my system, "make test" never skips any of the tests, even when run as my normal login user.> I suspect it's more likely a test failure then a code failureYup. I fixed the problem by changing the relevant rsync options to preserve the group (and also the user while I was at it). ..wayne..
Seemingly Similar Threads
- [PATCH] Updated patch to rsync for Stratus VOS
- Possible patch for Irix Makefile problem
- DO NOT REPLY [Bug 5472] New: FreeBSD 3.0.3pre2 'make check' failures
- DO NOT REPLY [Bug 5473] New: OS-X Leopard Rsync 3.0.3pre2 make check failures
- DO NOT REPLY [Bug 5470] New: Make check failures on Solaris 10 with rsync 3.0.3pre2