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

« back to all changes in this revision

Viewing changes to tools/client-side/svn-bench/util.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:
1
 
/*
2
 
 * util.c: Subversion command line client utility functions. Any
3
 
 * functions that need to be shared across subcommands should be put
4
 
 * in here.
5
 
 *
6
 
 * ====================================================================
7
 
 *    Licensed to the Apache Software Foundation (ASF) under one
8
 
 *    or more contributor license agreements.  See the NOTICE file
9
 
 *    distributed with this work for additional information
10
 
 *    regarding copyright ownership.  The ASF licenses this file
11
 
 *    to you under the Apache License, Version 2.0 (the
12
 
 *    "License"); you may not use this file except in compliance
13
 
 *    with the License.  You may obtain a copy of the License at
14
 
 *
15
 
 *      http://www.apache.org/licenses/LICENSE-2.0
16
 
 *
17
 
 *    Unless required by applicable law or agreed to in writing,
18
 
 *    software distributed under the License is distributed on an
19
 
 *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20
 
 *    KIND, either express or implied.  See the License for the
21
 
 *    specific language governing permissions and limitations
22
 
 *    under the License.
23
 
 * ====================================================================
24
 
 */
25
 
 
26
 
/* ==================================================================== */
27
 
 
28
 
 
29
 
 
30
 
/*** Includes. ***/
31
 
 
32
 
#include <string.h>
33
 
#include <ctype.h>
34
 
#include <assert.h>
35
 
 
36
 
#include "svn_private_config.h"
37
 
#include "svn_error.h"
38
 
#include "svn_path.h"
39
 
 
40
 
#include "cl.h"
41
 
 
42
 
 
43
 
 
44
 
svn_error_t *
45
 
svn_cl__args_to_target_array_print_reserved(apr_array_header_t **targets,
46
 
                                            apr_getopt_t *os,
47
 
                                            const apr_array_header_t *known_targets,
48
 
                                            svn_client_ctx_t *ctx,
49
 
                                            svn_boolean_t keep_last_origpath_on_truepath_collision,
50
 
                                            apr_pool_t *pool)
51
 
{
52
 
  svn_error_t *err = svn_client_args_to_target_array2(targets,
53
 
                                                      os,
54
 
                                                      known_targets,
55
 
                                                      ctx,
56
 
                                                      keep_last_origpath_on_truepath_collision,
57
 
                                                      pool);
58
 
  if (err)
59
 
    {
60
 
      if (err->apr_err ==  SVN_ERR_RESERVED_FILENAME_SPECIFIED)
61
 
        {
62
 
          svn_handle_error2(err, stderr, FALSE, "svn: Skipping argument: ");
63
 
          svn_error_clear(err);
64
 
        }
65
 
      else
66
 
        return svn_error_trace(err);
67
 
    }
68
 
  return SVN_NO_ERROR;
69
 
}
70
 
 
71
 
svn_error_t *
72
 
svn_cl__check_target_is_local_path(const char *target)
73
 
{
74
 
  if (svn_path_is_url(target))
75
 
    return svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
76
 
                             _("'%s' is not a local path"), target);
77
 
  return SVN_NO_ERROR;
78
 
}
79
 
 
80
 
const char *
81
 
svn_cl__local_style_skip_ancestor(const char *parent_path,
82
 
                                  const char *path,
83
 
                                  apr_pool_t *pool)
84
 
{
85
 
  const char *relpath = NULL;
86
 
 
87
 
  if (parent_path)
88
 
    relpath = svn_dirent_skip_ancestor(parent_path, path);
89
 
 
90
 
  return svn_dirent_local_style(relpath ? relpath : path, pool);
91
 
}
92