Use umask kluge from rsync.fns to try to get rid of a potential
[rsync/rsync.git] / testsuite / itemize.test
index 2f91ec0..563bda9 100644 (file)
@@ -23,7 +23,10 @@ makepath "$fromdir/bar/baz"
 cp -p "$srcdir/config.h" "$fromdir/foo/config1"
 cp -p "$srcdir/config.h.in" "$fromdir/foo/config2"
 cp -p "$srcdir/rsync.h" "$fromdir/bar/baz/rsync"
+chmod 600 "$fromdir"/foo/config? "$fromdir/bar/baz/rsync"
+umask 0
 ln -s ../bar/baz/rsync "$fromdir/foo/sym"
+umask 022
 ln "$fromdir/foo/config1" "$fromdir/foo/extra"
 
 $RSYNC -iplr "$fromdir/" "$todir/" \
@@ -43,12 +46,13 @@ EOT
 $RSYNC -a -f '-! */' "$fromdir/" "$todir"
 
 cp -p "$srcdir/config.h" "$fromdir/foo/config2"
+chmod 601 "$fromdir/foo/config2"
 $RSYNC -iplrH "$fromdir/" "$todir/" \
     | tee "$outfile"
 cat <<EOT | diff $diffopt - "$outfile" || test_fail "test 2 failed"
 >f..T.... bar/baz/rsync
 >f..T.... foo/config1
->f.sT.... foo/config2
+>f.sTp... foo/config2
 hf..T.... foo/extra => foo/config1
 EOT
 
@@ -57,6 +61,7 @@ sleep 1 # For directory mod below to ensure time difference
 rm "$todir/foo/sym"
 ln -s ../bar/baz "$todir/foo/sym"
 cp -p "$srcdir/config.h.in" "$fromdir/foo/config2"
+chmod 600 "$fromdir/foo/config2"
 chmod 777 "$todir/bar/baz/rsync"
 
 $RSYNC -iplrtc "$fromdir/" "$todir/" \
@@ -65,14 +70,15 @@ cat <<EOT | diff $diffopt - "$outfile" || test_fail "test 3 failed"
 .f..tp... bar/baz/rsync
 .d..t.... foo/
 .f..t.... foo/config1
->fcst.... foo/config2
+>fcstp... foo/config2
 cL..T.... foo/sym -> ../bar/baz/rsync
 EOT
 
 cp -p "$srcdir/config.h" "$fromdir/foo/config2"
+chmod 600 "$fromdir/foo/config2"
 # Lack of -t is for unchanged hard-link stress-test!
 $RSYNC -vvplrH "$fromdir/" "$todir/" \
-    | sed -e '0,/done$/d' -e '/--whole-file/d' -e '/total:/d' -e '/^$/,$d' \
+    | sed -e '1,/done$/d' -e '/--whole-file/d' -e '/total:/d' -e '/^$/,$d' \
     | tee "$outfile"
 cat <<EOT | diff $diffopt - "$outfile" || test_fail "test 4 failed"
 bar/baz/rsync is uptodate
@@ -102,7 +108,7 @@ EOT
 chmod 757 "$todir/foo/config1"
 touch "$todir/foo/config2"
 $RSYNC -vplrtH "$fromdir/" "$todir/" \
-    | sed -e '0,/done$/d' -e '/^$/,$d' \
+    | sed -e '/done$/d' -e '/^$/,$d' \
     | tee "$outfile"
 cat <<EOT | diff $diffopt - "$outfile" || test_fail "test 6 failed"
 foo/config2