~ubuntu-branches/debian/sid/subversion/sid

« back to all changes in this revision

Viewing changes to subversion/libsvn_fs/editor.c

  • Committer: Package Import Robot
  • Author(s): James McCoy
  • Date: 2015-08-07 21:32:47 UTC
  • mfrom: (0.2.15) (4.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20150807213247-ozyewtmgsr6tkewl
Tags: 1.9.0-1
* Upload to unstable
* New upstream release.
  + Security fixes
    - CVE-2015-3184: Mixed anonymous/authenticated path-based authz with
      httpd 2.4
    - CVE-2015-3187: svn_repos_trace_node_locations() reveals paths hidden
      by authz
* Add >= 2.7 requirement for python-all-dev Build-Depends, needed to run
  tests.
* Remove Build-Conflicts against ruby-test-unit.  (Closes: #791844)
* Remove patches/apache_module_dependency in favor of expressing the
  dependencies in authz_svn.load/dav_svn.load.
* Build-Depend on apache2-dev (>= 2.4.16) to ensure ap_some_authn_required()
  is available when building mod_authz_svn and Depend on apache2-bin (>=
  2.4.16) for runtime support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
  svn_fs_root_t *root;
63
63
};
64
64
 
65
 
#define FSPATH(relpath, pool) apr_pstrcat(pool, "/", relpath, NULL)
66
 
#define UNUSED(x) ((void)(x))
67
 
 
 
65
#define FSPATH(relpath, pool) apr_pstrcat(pool, "/", relpath, SVN_VA_NULL)
68
66
 
69
67
static svn_error_t *
70
68
get_root(svn_fs_root_t **root,
94
92
  for (hi = apr_hash_first(scratch_pool, props); hi;
95
93
       hi = apr_hash_next(hi))
96
94
    {
97
 
      const char *name = svn__apr_hash_index_key(hi);
98
 
      const svn_string_t *value = svn__apr_hash_index_val(hi);
 
95
      const char *name = apr_hash_this_key(hi);
 
96
      const svn_string_t *value = apr_hash_this_val(hi);
99
97
 
100
98
      svn_pool_clear(iterpool);
101
99
 
177
175
  SVN_ERR(svn_fs_node_created_rev(&created_rev, txn_root, fspath,
178
176
                                  scratch_pool));
179
177
 
180
 
  /* Uncommitted nodes (eg. a descendent of a copy/move/rotate destination)
 
178
  /* Uncommitted nodes (eg. a descendant of a copy/move destination)
181
179
     have no (committed) revision number. Let the caller go ahead and
182
180
     modify these nodes.
183
181
 
195
193
     have supplied a valid revision number [that they expect to change].
196
194
     The checks further below will determine the out-of-dateness of the
197
195
     specified revision.  */
198
 
  /* ### ugh. descendents of copy/move/rotate destinations carry along
 
196
  /* ### ugh. descendants of copy/move destinations carry along
199
197
     ### their original immutable state and (thus) a valid CREATED_REV.
200
198
     ### but they are logically uncommitted, so the caller will pass
201
199
     ### SVN_INVALID_REVNUM. (technically, the caller could provide
203
201
     ### API).
204
202
     ###
205
203
     ### for now, we will assume the caller knows what they are doing
206
 
     ### and an invalid revision implies such a descendent. in the
 
204
     ### and an invalid revision implies such a descendant. in the
207
205
     ### future, we could examine the ancestor chain looking for a
208
 
     ### copy/move/rotate-here node and allow the modification (and the
 
206
     ### copy/move-here node and allow the modification (and the
209
207
     ### converse: if no such ancestor, the caller must specify the
210
208
     ### correct/intended revision to modify).
211
209
  */
240
238
         of those new revisions.
241
239
         In either case, the node may not have changed in those new
242
240
         revisions; use the node's ID to determine this case.  */
243
 
      const svn_fs_id_t *txn_noderev_id;
244
241
      svn_fs_root_t *rev_root;
245
 
      const svn_fs_id_t *new_noderev_id;
246
 
 
247
 
      /* The ID of the node that we would be modifying in the txn  */
248
 
      SVN_ERR(svn_fs_node_id(&txn_noderev_id, txn_root, fspath,
249
 
                             scratch_pool));
 
242
      svn_fs_node_relation_t relation;
250
243
 
251
244
      /* Get the ID from the future/new revision.  */
252
245
      SVN_ERR(svn_fs_revision_root(&rev_root, svn_fs_root_fs(txn_root),
253
246
                                   revision, scratch_pool));
254
 
      SVN_ERR(svn_fs_node_id(&new_noderev_id, rev_root, fspath,
255
 
                             scratch_pool));
 
247
      SVN_ERR(svn_fs_node_relation(&relation, txn_root, fspath, rev_root,
 
248
                                   fspath, scratch_pool));
256
249
      svn_fs_close_root(rev_root);
257
250
 
258
251
      /* Has the target node changed in the future?  */
259
 
      if (svn_fs_compare_ids(txn_noderev_id, new_noderev_id) != 0)
 
252
      if (relation != svn_fs_node_unchanged)
260
253
        {
261
254
          /* Restarting the commit will base the txn on the future/new
262
255
             revision, allowing the modification at REVISION.  */
299
292
     ### test the ancestor to determine if it has been *-here in this
300
293
     ### txn, or just a simple modification.  */
301
294
 
302
 
  /* Are any of the parents copied/moved/rotated-here?  */
 
295
  /* Are any of the parents copied/moved-here?  */
303
296
  for (cur_fspath = fspath;
304
297
       strlen(cur_fspath) > 1;  /* not the root  */
305
298
       cur_fspath = svn_fspath__dirname(cur_fspath, scratch_pool))
488
481
alter_file_cb(void *baton,
489
482
              const char *relpath,
490
483
              svn_revnum_t revision,
491
 
              apr_hash_t *props,
492
484
              const svn_checksum_t *checksum,
493
485
              svn_stream_t *contents,
 
486
              apr_hash_t *props,
494
487
              apr_pool_t *scratch_pool)
495
488
{
496
489
  struct edit_baton *eb = baton;
521
514
alter_symlink_cb(void *baton,
522
515
                 const char *relpath,
523
516
                 svn_revnum_t revision,
524
 
                 apr_hash_t *props,
525
517
                 const char *target,
 
518
                 apr_hash_t *props,
526
519
                 apr_pool_t *scratch_pool)
527
520
{
528
521
  struct edit_baton *eb = baton;
529
522
 
530
 
  UNUSED(eb); SVN__NOT_IMPLEMENTED();
 
523
  SVN_UNUSED(eb);
 
524
  SVN__NOT_IMPLEMENTED();
531
525
}
532
526
 
533
527
 
633
627
}
634
628
 
635
629
 
636
 
/* This implements svn_editor_cb_rotate_t */
637
 
static svn_error_t *
638
 
rotate_cb(void *baton,
639
 
          const apr_array_header_t *relpaths,
640
 
          const apr_array_header_t *revisions,
641
 
          apr_pool_t *scratch_pool)
642
 
{
643
 
  struct edit_baton *eb = baton;
644
 
 
645
 
  UNUSED(eb); SVN__NOT_IMPLEMENTED();
646
 
}
647
 
 
648
 
 
649
630
/* This implements svn_editor_cb_complete_t */
650
631
static svn_error_t *
651
632
complete_cb(void *baton,
714
695
    delete_cb,
715
696
    copy_cb,
716
697
    move_cb,
717
 
    rotate_cb,
718
698
    complete_cb,
719
699
    abort_cb
720
700
  };
804
784
 
805
785
  if (!err)
806
786
    err = svn_fs_commit_txn(&inner_conflict_path,
807
 
                            revision,
808
 
                            eb->txn,
809
 
                            scratch_pool);
 
787
                             revision,
 
788
                             eb->txn,
 
789
                             scratch_pool);
810
790
  if (SVN_IS_VALID_REVNUM(*revision))
811
791
    {
812
792
      if (err)
829
809
          /* Copy this into the correct pool (see note above).  */
830
810
          *conflict_path = apr_pstrdup(result_pool, inner_conflict_path);
831
811
 
832
 
          /* Return sucess. The caller should inspect CONFLICT_PATH to
 
812
          /* Return success. The caller should inspect CONFLICT_PATH to
833
813
             determine this particular case.  */
834
814
          svn_error_clear(err);
835
815
          err = SVN_NO_ERROR;