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

« back to all changes in this revision

Viewing changes to subversion/libsvn_subr/log.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:
36
36
#include "svn_path.h"
37
37
#include "svn_pools.h"
38
38
#include "svn_string.h"
 
39
#include "svn_hash.h"
39
40
 
40
41
#include "private/svn_log.h"
41
42
 
45
46
{
46
47
  if (depth == svn_depth_unknown)
47
48
    return "";
48
 
  return apr_pstrcat(pool, " depth=", svn_depth_to_word(depth), (char *)NULL);
 
49
  return apr_pstrcat(pool, " depth=", svn_depth_to_word(depth), SVN_VA_NULL);
49
50
}
50
51
 
51
52
static const char *
306
307
}
307
308
 
308
309
const char *
309
 
svn_log__lock(const apr_array_header_t *paths,
 
310
svn_log__lock(apr_hash_t *targets,
310
311
              svn_boolean_t steal, apr_pool_t *pool)
311
312
{
312
 
  int i;
 
313
  apr_hash_index_t *hi;
313
314
  apr_pool_t *iterpool = svn_pool_create(pool);
314
315
  svn_stringbuf_t *space_separated_paths = svn_stringbuf_create_empty(pool);
315
316
 
316
 
  for (i = 0; i < paths->nelts; i++)
 
317
  for (hi = apr_hash_first(pool, targets); hi; hi = apr_hash_next(hi))
317
318
    {
318
 
      const char *path = APR_ARRAY_IDX(paths, i, const char *);
 
319
      const char *path = apr_hash_this_key(hi);
319
320
      svn_pool_clear(iterpool);
320
 
      if (i != 0)
 
321
      if (space_separated_paths->len)
321
322
        svn_stringbuf_appendcstr(space_separated_paths, " ");
322
323
      svn_stringbuf_appendcstr(space_separated_paths,
323
324
                               svn_path_uri_encode(path, iterpool));
329
330
}
330
331
 
331
332
const char *
332
 
svn_log__unlock(const apr_array_header_t *paths,
 
333
svn_log__unlock(apr_hash_t *targets,
333
334
                svn_boolean_t break_lock, apr_pool_t *pool)
334
335
{
335
 
  int i;
 
336
  apr_hash_index_t *hi;
336
337
  apr_pool_t *iterpool = svn_pool_create(pool);
337
338
  svn_stringbuf_t *space_separated_paths = svn_stringbuf_create_empty(pool);
338
339
 
339
 
  for (i = 0; i < paths->nelts; i++)
 
340
  for (hi = apr_hash_first(pool, targets); hi; hi = apr_hash_next(hi))
340
341
    {
341
 
      const char *path = APR_ARRAY_IDX(paths, i, const char *);
 
342
      const char *path = apr_hash_this_key(hi);
342
343
      svn_pool_clear(iterpool);
343
 
      if (i != 0)
 
344
      if (space_separated_paths->len)
344
345
        svn_stringbuf_appendcstr(space_separated_paths, " ");
345
346
      svn_stringbuf_appendcstr(space_separated_paths,
346
347
                               svn_path_uri_encode(path, iterpool));
355
356
svn_log__lock_one_path(const char *path, svn_boolean_t steal,
356
357
                       apr_pool_t *pool)
357
358
{
358
 
    apr_array_header_t *paths = apr_array_make(pool, 1, sizeof(path));
359
 
    APR_ARRAY_PUSH(paths, const char *) = path;
360
 
    return svn_log__lock(paths, steal, pool);
 
359
  apr_hash_t *paths = apr_hash_make(pool);
 
360
  svn_hash_sets(paths, path, path);
 
361
  return svn_log__lock(paths, steal, pool);
361
362
}
362
363
 
363
364
const char *
364
365
svn_log__unlock_one_path(const char *path, svn_boolean_t break_lock,
365
366
                         apr_pool_t *pool)
366
367
{
367
 
    apr_array_header_t *paths = apr_array_make(pool, 1, sizeof(path));
368
 
    APR_ARRAY_PUSH(paths, const char *) = path;
369
 
    return svn_log__unlock(paths, break_lock, pool);
 
368
  apr_hash_t *paths = apr_hash_make(pool);
 
369
  svn_hash_sets(paths, path, path);
 
370
  return svn_log__unlock(paths, break_lock, pool);
370
371
}
371
372
 
372
373
const char *