lock.c revision 4c260cabe6e3d966b55f75f15a02eeb40d3e0bd3
7abe86bacd7821fb83a784398037defc64060a2emanoj/* Licensed to the Apache Software Foundation (ASF) under one or more
7abe86bacd7821fb83a784398037defc64060a2emanoj * contributor license agreements. See the NOTICE file distributed with
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantz * this work for additional information regarding copyright ownership.
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantz * The ASF licenses this file to You under the Apache License, Version 2.0
809c98e396829d27f2d9efc0c27f7bb1294381bcgstein * (the "License"); you may not use this file except in compliance with
7abe86bacd7821fb83a784398037defc64060a2emanoj * the License. You may obtain a copy of the License at
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantz * Unless required by applicable law or agreed to in writing, software
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantz * distributed under the License is distributed on an "AS IS" BASIS,
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantz * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantz * See the License for the specific language governing permissions and
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantz * limitations under the License.
b4a287513d176e4355dd56ea47b27228e0e5d75fjerenkrantz** DAV filesystem lock implementation
480706fbb16436bfdff23c83c8993875ae7ece92minfrin/* ---------------------------------------------------------------
480706fbb16436bfdff23c83c8993875ae7ece92minfrin** Lock database primitives
aefffd0b370de6f499564ff7e0576c931a53fccdstoddard** LOCK DATABASES
322b350d0f1ac750b112ec15481a33efc92d182cjerenkrantz** Lockdiscovery information is stored in the single lock database specified
e9f8410b788ef1e6f1baed6c706ffdf3da395a16jerenkrantz** by the DAVLockDB directive. Information about this db is stored in the
e9f8410b788ef1e6f1baed6c706ffdf3da395a16jerenkrantz** global server configuration.
7416a4d524cc7456c90a155e06fae5ac6c2d0288trawick** The database is keyed by a key_type unsigned char (DAV_TYPE_FNAME)
7416a4d524cc7456c90a155e06fae5ac6c2d0288trawick** followed by the full path. The key_type DAV_TYPE_INODE is not used anymore.
c803b0d84b48f151504b87ec3f196cb433149592rbb** The value consists of a list of elements.
#define DAV_FALSE 0
const char *filename,
struct dav_locktoken {
typedef struct dav_lock_discovery_fixed
char scope;
char type;
int depth;
typedef struct dav_lock_discovery
struct dav_lock_discovery_fixed f;
typedef struct dav_lock_indirect
+ sizeof(apr_uuid_t) \
+ sizeof(time_t) \
struct dav_lockdb_private
struct dav_lock_private
apr_pool_t *p,
const char *char_token,
return dav_new_error(p,
return NULL;
static const char *dav_fs_format_locktoken(
apr_pool_t *p,
static int dav_fs_compare_locktoken(
return NULL;
err);
return NULL;
if (force) {
return NULL;
return key;
char *ptr;
#if DAV_DEBUG
HTTP_INTERNAL_SERVER_ERROR, 0, 0,
return err;
return NULL;
while(dp) {
while(ip) {
while(dp) {
while(ip) {
err);
return NULL;
int add_method,
return err;
return NULL;
return err;
return NULL;
case DAV_LOCK_DIRECT:
++offset;
++offset;
return err;
case DAV_LOCK_INDIRECT:
--offset;
return dav_new_error(p,
apr_psprintf(p,
return NULL;
return err;
return NULL;
return supported;
p) != APR_SUCCESS) {
return NULL;
apr_psprintf(p,
goto loaderror;
apr_psprintf(p,
goto loaderror;
apr_psprintf(p,
goto loaderror;
return err;
const char *pathname;
return NULL;
NULL);
apr_psprintf(p,
return NULL;
apr_psprintf(p,
pathname));
!= APR_SUCCESS) {
apr_psprintf(p,
return err;
const char *filename,
char *scan;
const char *scanend;
int dirty = 0;
return err;
if (dirty) {
return err;
return NULL;
/* Note: used by dav_fs_repos.c */
const char *dirpath;
const char *dirpath;
const char *fname;
return NULL;
return err;
return NULL;
key,
NULL);
return NULL;
int calltype,
#if DAV_DEBUG
HTTP_INTERNAL_SERVER_ERROR, 0, 0,
return err;
return err;
return NULL;
int partial_ok,
return err;
return NULL;
if (partial_ok) {
return err;
return NULL;
return NULL;
int *locks_present)
*locks_present = 0;
return err;
return NULL;
return NULL;
int make_indirect,
return err;
if (make_indirect) {
return err;
return err;
return NULL;
return err;
if (dprev)
if (iprev)
return err;
return err;
return NULL;
int dirty = 0;
return dirty;
int dirty = 0;
return err;
if (dirty
return err;
return err;
return err;
return NULL;