subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kot...@apache.org
Subject svn commit: r1667235 - /subversion/trunk/subversion/mod_dav_svn/deadprops.c
Date Tue, 17 Mar 2015 10:18:43 GMT
Author: kotkov
Date: Tue Mar 17 10:18:42 2015
New Revision: 1667235

URL: http://svn.apache.org/r1667235
Log:
mod_dav_svn: Reject invalid transaction property change requests.

* subversion/mod_dav_svn/deadprops.c
  (change_txn_prop): New helper function that performs sanity checking.
  (save_value, db_remove): Use new helper.

Modified:
    subversion/trunk/subversion/mod_dav_svn/deadprops.c

Modified: subversion/trunk/subversion/mod_dav_svn/deadprops.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/deadprops.c?rev=1667235&r1=1667234&r2=1667235&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/deadprops.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/deadprops.c Tue Mar 17 10:18:42 2015
@@ -163,6 +163,23 @@ get_value(dav_db *db, const dav_prop_nam
 }
 
 
+static svn_error_t *
+change_txn_prop(svn_fs_txn_t *txn,
+                const char *propname,
+                const svn_string_t *value,
+                apr_pool_t *scratch_pool)
+{
+  if (strcmp(propname, SVN_PROP_REVISION_AUTHOR) == 0)
+    return svn_error_create(SVN_ERR_RA_DAV_REQUEST_FAILED, NULL,
+                            "Attempted to modify 'svn:author' property "
+                            "on a transaction");
+
+  SVN_ERR(svn_repos_fs_change_txn_prop(txn, propname, value, scratch_pool));
+
+  return SVN_NO_ERROR;
+}
+
+
 static dav_error *
 save_value(dav_db *db, const dav_prop_name *name,
            const svn_string_t *const *old_value_p,
@@ -213,9 +230,8 @@ save_value(dav_db *db, const dav_prop_na
     {
       if (resource->working)
         {
-          serr = svn_repos_fs_change_txn_prop(resource->info->root.txn,
-                                              propname, value,
-                                              subpool);
+          serr = change_txn_prop(resource->info->root.txn, propname,
+                                 value, subpool);
         }
       else
         {
@@ -254,8 +270,8 @@ save_value(dav_db *db, const dav_prop_na
     }
   else if (resource->info->restype == DAV_SVN_RESTYPE_TXN_COLLECTION)
     {
-      serr = svn_repos_fs_change_txn_prop(resource->info->root.txn,
-                                          propname, value, subpool);
+      serr = change_txn_prop(resource->info->root.txn, propname,
+                             value, subpool);
     }
   else
     {
@@ -560,8 +576,8 @@ db_remove(dav_db *db, const dav_prop_nam
   /* Working Baseline or Working (Version) Resource */
   if (db->resource->baselined)
     if (db->resource->working)
-      serr = svn_repos_fs_change_txn_prop(db->resource->info->root.txn,
-                                          propname, NULL, subpool);
+      serr = change_txn_prop(db->resource->info->root.txn, propname,
+                             NULL, subpool);
     else
       /* ### VIOLATING deltaV: you can't proppatch a baseline, it's
          not a working resource!  But this is how we currently



Mime
View raw message