[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Simpler and safer DAV proxy sync script

From: Peter Samuelson <peter_at_p12n.org>
Date: Mon, 30 Jun 2008 23:24:42 -0500

Is there any reason not to recommend this much simpler procedure for
DAV mirroring? It is not only simpler and faster, but closes a
security hole in temp file handling on the master.

-- 
Peter Samuelson | org-tld!p12n!peter | http://p12n.org/
[[[
Use a simple pipe for svnadmin dump / load in the WebDAV proxy
example scripts, instead of temporary files.
* notes/webdav-proxy: Rewrite mirror hook example to use a pipe instead
    of a temp file.  Also use -q in svnadmin dump|load, because nobody
    needs to see the verbose output.
* www/svn_1.5_releasenotes.html (webdav-proxy-example): Likewise.
]]]
Index: www/svn_1.5_releasenotes.html
===================================================================
--- www/svn_1.5_releasenotes.html	(revisione 31895)
+++ www/svn_1.5_releasenotes.html	(copia locale)
@@ -1164,11 +1164,9 @@
    SLAVE_PATH=/my/local/copy/of/repos
 
    # Ensure svnadmin is in $PATH on both this machine and the remote server!
-   svnadmin dump --incremental -r$2 $1 &gt; /tmp/$2.dump
-   scp /tmp/$2.dump $SLAVE_HOST:$SLAVE_PATH
-   ssh $SLAVE_HOST "svnadmin load $SLAVE_PATH &lt; $SLAVE_PATH/$2.dump"
-   ssh $SLAVE_HOST "rm $SLAVE_PATH/$2.dump"
-   rm /tmp/$2.dump
+
+   svnadmin dump -q --incremental -r$REV "$REPOS" |
+     ssh $SLAVE_HOST "svnadmin load -q $SLAVE_PATH"
 </code></pre>
 
 </div>  <!-- webdav-proxy-example -->
Index: notes/webdav-proxy
===================================================================
--- notes/webdav-proxy	(revisione 31895)
+++ notes/webdav-proxy	(copia locale)
@@ -62,11 +62,8 @@
 SLAVE_PATH=/my/local/copy/of/repos
 
 # Ensure svnadmin is in your PATH on both this machine and the remote server!
-svnadmin dump --incremental -r$2 $1 > /tmp/$2.dump
-scp /tmp/$2.dump $SLAVE_HOST:$SLAVE_PATH
-ssh $SLAVE_HOST "svnadmin load $SLAVE_PATH < $SLAVE_PATH/$2.dump"
-ssh $SLAVE_HOST "rm $SLAVE_PATH/$2.dump"
-rm /tmp/$2.dump
+svnadmin dump -q --incremental -r$REV "$REPOS" |
+  ssh $SLAVE_HOST "svnadmin load -q $SLAVE_PATH"
 ----
 
 Issues/Thoughts:

Received on 2008-07-01 06:24:57 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.