[patch] Two problems in testsuite (POSIX, perms)
Brian Poole
raj at cerias.purdue.edu
Tue Jan 21 20:15:00 EST 2003
Quoting Wayne Davison (wayned at users.sourceforge.net) from 21 January 2003:
> Here's the patch I ended up committing. Note that I had to change the
> names of the UID/GID vars (since they can be read-only vars in certain
> shells) and that I ensured that the chown would happen if any user has
> the permissions to run the chown command (not just if that user is named
> "root").
Looks mostly good to me, except the chown part went into the download
test when it should have been the upload test.. the download test
works fine without the chown, it is the upload that requires it.
The semantics of what is proper POSIX behavior is unknown to me. I
personally didn't care enough to go looking much ;-) Just wanted to
see something that would work. If someone does know or wants to
investigate feel free; if OpenBSD's behavior is wrong it would
probably be corrected.
Good catch with the UID/GID bit and the command substitution.. I'm
afraid I simply don't know all of the quirks and feature supports
out there.
-b
Index: testsuite/daemon-gzip-download.test
===================================================================
RCS file: /cvsroot/rsync/testsuite/daemon-gzip-download.test,v
retrieving revision 1.3
diff -u -r1.3 daemon-gzip-download.test
--- testsuite/daemon-gzip-download.test 21 Jan 2003 19:30:51 -0000 1.3
+++ testsuite/daemon-gzip-download.test 21 Jan 2003 20:12:11 -0000
@@ -28,11 +28,5 @@
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 localhost::test-from/ \"$TO/\"" "$FROM" "$TO"
Index: testsuite/daemon-gzip-upload.test
===================================================================
RCS file: /cvsroot/rsync/testsuite/daemon-gzip-upload.test,v
retrieving revision 1.2
diff -u -r1.2 daemon-gzip-upload.test
--- testsuite/daemon-gzip-upload.test 24 Dec 2002 07:25:25 -0000 1.2
+++ testsuite/daemon-gzip-upload.test 21 Jan 2003 20:12:11 -0000
@@ -21,5 +21,11 @@
export RSYNC_CONNECT_PROG
hands_setup
-checkit "$RSYNC -avvz \"$FROM/\" localhost::test-to/" "$FROM" "$TO"
+# 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"
-------------- next part --------------
Index: testsuite/daemon-gzip-download.test
===================================================================
RCS file: /cvsroot/rsync/testsuite/daemon-gzip-download.test,v
retrieving revision 1.3
diff -u -r1.3 daemon-gzip-download.test
--- testsuite/daemon-gzip-download.test 21 Jan 2003 19:30:51 -0000 1.3
+++ testsuite/daemon-gzip-download.test 21 Jan 2003 20:12:11 -0000
@@ -28,11 +28,5 @@
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 localhost::test-from/ \"$TO/\"" "$FROM" "$TO"
Index: testsuite/daemon-gzip-upload.test
===================================================================
RCS file: /cvsroot/rsync/testsuite/daemon-gzip-upload.test,v
retrieving revision 1.2
diff -u -r1.2 daemon-gzip-upload.test
--- testsuite/daemon-gzip-upload.test 24 Dec 2002 07:25:25 -0000 1.2
+++ testsuite/daemon-gzip-upload.test 21 Jan 2003 20:12:11 -0000
@@ -21,5 +21,11 @@
export RSYNC_CONNECT_PROG
hands_setup
-checkit "$RSYNC -avvz \"$FROM/\" localhost::test-to/" "$FROM" "$TO"
+# 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"
More information about the rsync
mailing list