Chown the $TO and $FROM directories to $RSYNCD_UID:$RSYNCD_GID (if we
authorWayne Davison <wayned@samba.org>
Tue, 21 Jan 2003 20:19:53 +0000 (20:19 +0000)
committerWayne Davison <wayned@samba.org>
Tue, 21 Jan 2003 20:19:53 +0000 (20:19 +0000)
can, and don't fail if we can't).

testsuite/daemon-gzip-upload.test

index 04642ac..49ddba9 100644 (file)
@@ -21,5 +21,12 @@ RSYNC_CONNECT_PROG="$RSYNC --config=$conf --daemon"
 export RSYNC_CONNECT_PROG
 
 hands_setup
+
+# If we are root, we must allow the rsyncd process (which runs under
+# a different uid/gid) to write to the destination directory. Source
+# directory must be chown'ed as well so that UIDs & GIDs match when 
+# the source & destination are compared after copying.
+chown -R $RSYNCD_UID:$RSYNCD_GID "$FROM" "$TO" 2>/dev/null || true
+
 checkit "$RSYNC -avvz \"$FROM/\" localhost::test-to/" "$FROM" "$TO"