- Define what the valid access bits are for a name element and a
[rsync/rsync.git] / testsuite / chmod-option.test
index 2813ff2..3e5fd28 100644 (file)
@@ -9,8 +9,6 @@
 
 . $srcdir/testsuite/rsync.fns
 
-set -x
-
 # Build some files
 
 fromdir="$scratchdir/from"
@@ -40,5 +38,34 @@ chmod +w "$checkdir" "$checkdir"/dir*
 
 checkit "$RSYNC -avv --chmod ug-s,a+rX,D+w \"$fromdir/\" \"$todir/\"" "$checkdir" "$todir"
 
+rm -r "$fromdir" "$checkdir" "$todir"
+makepath "$todir" "$fromdir/foo"
+touch "$fromdir/bar"
+
+checkit "$RSYNC -avv \"$fromdir/\" \"$checkdir/\"" "$fromdir" "$checkdir"
+chmod o+x "$fromdir"/bar
+
+checkit "$RSYNC -avv --chmod=Fo-x \"$fromdir/\" \"$todir/\"" "$checkdir" "$todir"
+
+# Tickle a bug in rsync 2.6.8: if you push a new directory with --perms off to
+# a daemon with an incoming chmod, the daemon pretends the directory is a file
+# for the purposes of the second application of the incoming chmod.
+
+build_rsyncd_conf
+cat >>"$scratchdir/test-rsyncd.conf" <<EOF
+[test-incoming-chmod]
+       path = $todir
+       read only = no
+       incoming chmod = Fo-x
+EOF
+
+RSYNC_CONNECT_PROG="$RSYNC --config=$conf --daemon"
+export RSYNC_CONNECT_PROG
+
+rm -r "$todir"
+makepath "$todir"
+
+checkit "$RSYNC -avv --no-perms \"$fromdir/\" localhost::test-incoming-chmod/" "$checkdir" "$todir"
+
 # The script would have aborted on error, so getting here means we've won.
 exit 0