You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by cm...@apache.org on 2010/03/22 17:38:55 UTC
svn commit: r926167 - /subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
Author: cmpilato
Date: Mon Mar 22 16:38:55 2010
New Revision: 926167
URL: http://svn.apache.org/viewvc?rev=926167&view=rev
Log:
Port the BDB backend change from r926151 to the FSFS backend, also.
* subversion/libsvn_fs_fs/fs_fs.c
(fold_change): Protect against another form of invalid sequence,
where an 'add' follows other non-delete/reset changes on the same
node.
Suggested by: glasser
Modified:
subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=926167&r1=926166&r2=926167&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Mon Mar 22 16:38:55 2010
@@ -3861,6 +3861,15 @@ fold_change(apr_hash_t *changes,
(SVN_ERR_FS_CORRUPT, NULL,
_("Invalid change ordering: non-add change on deleted path"));
+ /* Sanity check: an add can't follow anything except
+ a delete or reset. */
+ if ((change->kind == svn_fs_path_change_add)
+ && (old_change->change_kind != svn_fs_path_change_delete)
+ && (old_change->change_kind != svn_fs_path_change_reset))
+ return svn_error_create
+ (SVN_ERR_FS_CORRUPT, NULL,
+ _("Invalid change ordering: add change on preexisting path"));
+
/* Now, merge that change in. */
switch (change->kind)
{