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

« back to all changes in this revision

Viewing changes to subversion/libsvn_fs_x/lock.h

  • 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
/* lock.h : internal interface to lock functions
 
2
 *
 
3
 * ====================================================================
 
4
 *    Licensed to the Apache Software Foundation (ASF) under one
 
5
 *    or more contributor license agreements.  See the NOTICE file
 
6
 *    distributed with this work for additional information
 
7
 *    regarding copyright ownership.  The ASF licenses this file
 
8
 *    to you under the Apache License, Version 2.0 (the
 
9
 *    "License"); you may not use this file except in compliance
 
10
 *    with the License.  You may obtain a copy of the License at
 
11
 *
 
12
 *      http://www.apache.org/licenses/LICENSE-2.0
 
13
 *
 
14
 *    Unless required by applicable law or agreed to in writing,
 
15
 *    software distributed under the License is distributed on an
 
16
 *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 
17
 *    KIND, either express or implied.  See the License for the
 
18
 *    specific language governing permissions and limitations
 
19
 *    under the License.
 
20
 * ====================================================================
 
21
 */
 
22
 
 
23
#ifndef SVN_LIBSVN_FS_LOCK_H
 
24
#define SVN_LIBSVN_FS_LOCK_H
 
25
 
 
26
#ifdef __cplusplus
 
27
extern "C" {
 
28
#endif /* __cplusplus */
 
29
 
 
30
 
 
31
 
 
32
/* These functions implement some of the calls in the FS loader
 
33
   library's fs vtables. */
 
34
 
 
35
/* See svn_fs_lock(), svn_fs_lock_many(). */
 
36
svn_error_t *
 
37
svn_fs_x__lock(svn_fs_t *fs,
 
38
               apr_hash_t *targets,
 
39
               const char *comment,
 
40
               svn_boolean_t is_dav_comment,
 
41
               apr_time_t expiration_date,
 
42
               svn_boolean_t steal_lock,
 
43
               svn_fs_lock_callback_t lock_callback,
 
44
               void *lock_baton,
 
45
               apr_pool_t *result_pool,
 
46
               apr_pool_t *scratch_pool);
 
47
 
 
48
/* See svn_fs_generate_lock_token(). */
 
49
svn_error_t *
 
50
svn_fs_x__generate_lock_token(const char **token,
 
51
                              svn_fs_t *fs,
 
52
                              apr_pool_t *pool);
 
53
 
 
54
/* See svn_fs_unlock(), svn_fs_unlock_many(). */
 
55
svn_error_t *
 
56
svn_fs_x__unlock(svn_fs_t *fs,
 
57
                 apr_hash_t *targets,
 
58
                 svn_boolean_t break_lock,
 
59
                 svn_fs_lock_callback_t lock_callback,
 
60
                 void *lock_baton,
 
61
                 apr_pool_t *result_pool,
 
62
                 apr_pool_t *scratch_pool);
 
63
 
 
64
/* See svn_fs_get_lock(). */
 
65
svn_error_t *
 
66
svn_fs_x__get_lock(svn_lock_t **lock,
 
67
                   svn_fs_t *fs,
 
68
                   const char *path,
 
69
                   apr_pool_t *pool);
 
70
 
 
71
/* See svn_fs_get_locks2(). */
 
72
svn_error_t *
 
73
svn_fs_x__get_locks(svn_fs_t *fs,
 
74
                    const char *path,
 
75
                    svn_depth_t depth,
 
76
                    svn_fs_get_locks_callback_t get_locks_func,
 
77
                    void *get_locks_baton,
 
78
                    apr_pool_t *scratch_pool);
 
79
 
 
80
 
 
81
/* Examine PATH for existing locks, and check whether they can be
 
82
   used.  Use SCRATCH_POOL for temporary allocations.
 
83
 
 
84
   If no locks are present, return SVN_NO_ERROR.
 
85
 
 
86
   If PATH is locked (or contains locks "below" it, when RECURSE is
 
87
   set), then verify that:
 
88
 
 
89
      1. a username has been supplied to TRAIL->fs's access-context,
 
90
         else return SVN_ERR_FS_NO_USER.
 
91
 
 
92
      2. for every lock discovered, the current username in the access
 
93
         context of TRAIL->fs matches the "owner" of the lock, else
 
94
         return SVN_ERR_FS_LOCK_OWNER_MISMATCH.
 
95
 
 
96
      3. for every lock discovered, a matching lock token has been
 
97
         passed into TRAIL->fs's access-context, else return
 
98
         SVN_ERR_FS_BAD_LOCK_TOKEN.
 
99
 
 
100
   If all three conditions are met, return SVN_NO_ERROR.
 
101
 
 
102
   If the caller (directly or indirectly) has the FS write lock,
 
103
   HAVE_WRITE_LOCK should be true.
 
104
*/
 
105
svn_error_t *
 
106
svn_fs_x__allow_locked_operation(const char *path,
 
107
                                 svn_fs_t *fs,
 
108
                                 svn_boolean_t recurse,
 
109
                                 svn_boolean_t have_write_lock,
 
110
                                 apr_pool_t *scratch_pool);
 
111
 
 
112
#ifdef __cplusplus
 
113
}
 
114
#endif /* __cplusplus */
 
115
 
 
116
#endif /* SVN_LIBSVN_FS_LOCK_H */