Apache HTTPD
Classes | Macros | Enumerations | Functions | Variables
repos.c File Reference
#include "apr.h"
#include "apr_file_io.h"
#include "apr_strings.h"
#include "apr_buckets.h"
#include "httpd.h"
#include "http_log.h"
#include "http_protocol.h"
#include "http_request.h"
#include "mod_dav.h"
#include "repos.h"

Go to the source code of this file.

Classes

struct  dav_resource_private
 
struct  dav_fs_walker_context
 
struct  dav_fs_copymove_walk_ctx
 
struct  dav_stream
 

Macros

#define DEBUG_GET_HANDLER   0
 
#define DAV_FS_COPY_BLOCKSIZE   16384 /* copy 16k at a time */
 
#define DAV_WALKTYPE_HIDDEN   0x4000
 
#define DAV_WALKTYPE_POSTFIX   0x8000
 
#define DAV_CALLTYPE_POSTFIX   1000 /* a private call type */
 
#define DAV_FS_HAS_EXECUTABLE
 
#define DAV_FINFO_MASK
 
#define DAV_PROPID_FS_executable   1
 
#define DAV_FS_TMP_PREFIX   ".davfs.tmp"
 
#define MAP_IO2HTTP(e)
 

Enumerations

enum  { DAV_FS_URI_DAV , DAV_FS_URI_MYPROPS }
 

Functions

static dav_errordav_fs_walk (const dav_walk_params *params, int depth, dav_response **response)
 
static dav_errordav_fs_internal_walk (const dav_walk_params *params, int depth, int is_move, const dav_resource *root_dst, dav_response **response)
 
static request_recdav_fs_get_request_rec (const dav_resource *resource)
 
apr_pool_tdav_fs_pool (const dav_resource *resource)
 
const chardav_fs_pathname (const dav_resource *resource)
 
dav_errordav_fs_dir_file_name (const dav_resource *resource, const char **dirpath_p, const char **fname_p)
 
static void dav_format_time (int style, apr_time_t sec, char *buf, apr_size_t buflen)
 
static dav_errordav_fs_copymove_file (int is_move, apr_pool_t *p, const char *src, const char *dst, const apr_finfo_t *src_finfo, const apr_finfo_t *dst_finfo, dav_buffer *pbuf)
 
static dav_errordav_fs_copymove_state (int is_move, apr_pool_t *p, const char *src_dir, const char *src_file, const char *dst_dir, const char *dst_file, dav_buffer *pbuf)
 
static dav_errordav_fs_copymoveset (int is_move, apr_pool_t *p, const dav_resource *src, const dav_resource *dst, dav_buffer *pbuf)
 
static dav_errordav_fs_deleteset (apr_pool_t *p, const dav_resource *resource)
 
static dav_errordav_fs_get_resource (request_rec *r, const char *root_dir, const char *label, int use_checked_in, dav_resource **result_resource)
 
static dav_errordav_fs_get_parent_resource (const dav_resource *resource, dav_resource **result_parent)
 
static int dav_fs_is_same_resource (const dav_resource *res1, const dav_resource *res2)
 
static int dav_fs_is_parent_resource (const dav_resource *res1, const dav_resource *res2)
 
static apr_status_t tmpfile_cleanup (void *data)
 
static apr_status_t dav_fs_mktemp (apr_file_t **fp, char *templ, apr_pool_t *p)
 
static dav_errordav_fs_open_stream (const dav_resource *resource, dav_stream_mode mode, dav_stream **stream)
 
static dav_errordav_fs_close_stream (dav_stream *stream, int commit)
 
static dav_errordav_fs_write_stream (dav_stream *stream, const void *buf, apr_size_t bufsize)
 
static dav_errordav_fs_seek_stream (dav_stream *stream, apr_off_t abs_pos)
 
static dav_errordav_fs_create_collection (dav_resource *resource)
 
static dav_errordav_fs_copymove_walker (dav_walk_resource *wres, int calltype)
 
static dav_errordav_fs_copymove_resource (int is_move, const dav_resource *src, const dav_resource *dst, int depth, dav_response **response)
 
static dav_errordav_fs_copy_resource (const dav_resource *src, dav_resource *dst, int depth, dav_response **response)
 
static dav_errordav_fs_move_resource (dav_resource *src, dav_resource *dst, dav_response **response)
 
static dav_errordav_fs_delete_walker (dav_walk_resource *wres, int calltype)
 
static dav_errordav_fs_remove_resource (dav_resource *resource, dav_response **response)
 
static dav_errordav_fs_walker (dav_fs_walker_context *fsctx, int depth)
 
static const chardav_fs_getetag (const dav_resource *resource)
 
static dav_prop_insert dav_fs_insert_prop (const dav_resource *resource, int propid, dav_prop_insert what, apr_text_header *phdr)
 
static int dav_fs_is_writable (const dav_resource *resource, int propid)
 
static dav_errordav_fs_patch_validate (const dav_resource *resource, const apr_xml_elem *elem, int operation, void **context, int *defer_to_dead)
 
static dav_errordav_fs_patch_exec (const dav_resource *resource, const apr_xml_elem *elem, int operation, void *context, dav_liveprop_rollback **rollback_ctx)
 
static void dav_fs_patch_commit (const dav_resource *resource, int operation, void *context, dav_liveprop_rollback *rollback_ctx)
 
static dav_errordav_fs_patch_rollback (const dav_resource *resource, int operation, void *context, dav_liveprop_rollback *rollback_ctx)
 
void dav_fs_gather_propsets (apr_array_header_t *uris)
 
int dav_fs_find_liveprop (const dav_resource *resource, const char *ns_uri, const char *name, const dav_hooks_liveprop **hooks)
 
void dav_fs_insert_all_liveprops (request_rec *r, const dav_resource *resource, dav_prop_insert what, apr_text_header *phdr)
 
void dav_fs_register (apr_pool_t *p)
 

Variables

static int *const aplog_module_index = &( dav_fs_module.module_index)
 
const dav_hooks_locks dav_hooks_locks_fs
 
static const dav_hooks_repository dav_hooks_repository_fs
 
static const dav_hooks_liveprop dav_hooks_liveprop_fs
 
static const char *const dav_fs_namespace_uris []
 
static const dav_liveprop_spec dav_fs_props []
 
static const dav_liveprop_group dav_fs_liveprop_group
 
static const dav_provider dav_fs_provider
 

Macro Definition Documentation

◆ DAV_CALLTYPE_POSTFIX

#define DAV_CALLTYPE_POSTFIX   1000 /* a private call type */

Definition at line 94 of file repos.c.

◆ DAV_FINFO_MASK

#define DAV_FINFO_MASK
Value:
#define APR_FINFO_INODE
#define APR_FINFO_CTIME
#define APR_FINFO_MTIME
#define APR_FINFO_LINK
#define APR_FINFO_TYPE
#define APR_FINFO_PROT
#define APR_FINFO_SIZE

Definition at line 130 of file repos.c.

◆ DAV_FS_COPY_BLOCKSIZE

#define DAV_FS_COPY_BLOCKSIZE   16384 /* copy 16k at a time */

Definition at line 43 of file repos.c.

◆ DAV_FS_HAS_EXECUTABLE

#define DAV_FS_HAS_EXECUTABLE

Definition at line 129 of file repos.c.

◆ DAV_FS_TMP_PREFIX

#define DAV_FS_TMP_PREFIX   ".davfs.tmp"

Definition at line 147 of file repos.c.

◆ DAV_PROPID_FS_executable

#define DAV_PROPID_FS_executable   1

Definition at line 142 of file repos.c.

◆ DAV_WALKTYPE_HIDDEN

#define DAV_WALKTYPE_HIDDEN   0x4000

Definition at line 89 of file repos.c.

◆ DAV_WALKTYPE_POSTFIX

#define DAV_WALKTYPE_POSTFIX   0x8000

Definition at line 92 of file repos.c.

◆ DEBUG_GET_HANDLER

#define DEBUG_GET_HANDLER   0

Definition at line 41 of file repos.c.

◆ MAP_IO2HTTP

#define MAP_IO2HTTP (   e)
Value:
#define APR_STATUS_IS_ENOSPC(s)
Definition apr_errno.h:1255
apr_bucket * e
#define HTTP_INSUFFICIENT_STORAGE
Definition httpd.h:542
#define HTTP_INTERNAL_SERVER_ERROR
Definition httpd.h:535
#define HTTP_CONFLICT
Definition httpd.h:517
apr_size_t size

Definition at line 207 of file repos.c.

Enumeration Type Documentation

◆ anonymous enum

Enumerator
DAV_FS_URI_DAV 
DAV_FS_URI_MYPROPS 

Definition at line 115 of file repos.c.

Function Documentation

◆ dav_format_time()

static void dav_format_time ( int  style,
apr_time_t  sec,
char buf,
apr_size_t  buflen 
)
static

Definition at line 297 of file repos.c.

◆ dav_fs_close_stream()

static dav_error * dav_fs_close_stream ( dav_stream stream,
int  commit 
)
static

Definition at line 983 of file repos.c.

◆ dav_fs_copy_resource()

static dav_error * dav_fs_copy_resource ( const dav_resource src,
dav_resource dst,
int  depth,
dav_response **  response 
)
static

Definition at line 1286 of file repos.c.

◆ dav_fs_copymove_file()

static dav_error * dav_fs_copymove_file ( int  is_move,
apr_pool_t p,
const char src,
const char dst,
const apr_finfo_t src_finfo,
const apr_finfo_t dst_finfo,
dav_buffer pbuf 
)
static

< all protections

< Execute by user

<

Deprecated:
See also
APR_FPROT_UEXECUTE

< use OS's default permissions

<

Deprecated:
See also
APR_FPROT_OS_DEFAULT

< Open the file for reading

<

Deprecated:
See also
APR_FOPEN_READ

< Open the file in binary mode (This flag is ignored on UNIX because it has no meaning)

<

Deprecated:
See also
APR_FOPEN_BINARY

< use OS's default permissions

<

Deprecated:
See also
APR_FPROT_OS_DEFAULT

< Open the file for writing

<

Deprecated:
See also
APR_FOPEN_WRITE

< Create the file if not there

<

Deprecated:
See also
APR_FOPEN_CREATE

< Open the file and truncate to 0 length

<

Deprecated:
See also
APR_FOPEN_TRUNCATE

< Open the file in binary mode (This flag is ignored on UNIX because it has no meaning)

<

Deprecated:
See also
APR_FOPEN_BINARY

Definition at line 327 of file repos.c.

◆ dav_fs_copymove_resource()

static dav_error * dav_fs_copymove_resource ( int  is_move,
const dav_resource src,
const dav_resource dst,
int  depth,
dav_response **  response 
)
static

Definition at line 1224 of file repos.c.

◆ dav_fs_copymove_state()

static dav_error * dav_fs_copymove_state ( int  is_move,
apr_pool_t p,
const char src_dir,
const char src_file,
const char dst_dir,
const char dst_file,
dav_buffer pbuf 
)
static

< an atomic unix apr_stat()

< use OS's default permissions

<

Deprecated:
See also
APR_FPROT_OS_DEFAULT

< an atomic unix apr_stat()

Definition at line 475 of file repos.c.

◆ dav_fs_copymove_walker()

static dav_error * dav_fs_copymove_walker ( dav_walk_resource wres,
int  calltype 
)
static

< use OS's default permissions

<

Deprecated:
See also
APR_FPROT_OS_DEFAULT

Definition at line 1162 of file repos.c.

◆ dav_fs_copymoveset()

static dav_error * dav_fs_copymoveset ( int  is_move,
apr_pool_t p,
const dav_resource src,
const dav_resource dst,
dav_buffer pbuf 
)
static

Definition at line 554 of file repos.c.

◆ dav_fs_create_collection()

static dav_error * dav_fs_create_collection ( dav_resource resource)
static

< use OS's default permissions

<

Deprecated:
See also
APR_FPROT_OS_DEFAULT

Definition at line 1133 of file repos.c.

◆ dav_fs_delete_walker()

static dav_error * dav_fs_delete_walker ( dav_walk_resource wres,
int  calltype 
)
static

Definition at line 1410 of file repos.c.

◆ dav_fs_deleteset()

static dav_error * dav_fs_deleteset ( apr_pool_t p,
const dav_resource resource 
)
static

Definition at line 613 of file repos.c.

◆ dav_fs_get_parent_resource()

static dav_error * dav_fs_get_parent_resource ( const dav_resource resource,
dav_resource **  result_parent 
)
static

< an atomic unix apr_stat()

Definition at line 773 of file repos.c.

◆ dav_fs_get_request_rec()

static request_rec * dav_fs_get_request_rec ( const dav_resource resource)
static

Definition at line 223 of file repos.c.

◆ dav_fs_get_resource()

static dav_error * dav_fs_get_resource ( request_rec r,
const char root_dir,
const char label,
int  use_checked_in,
dav_resource **  result_resource 
)
static

Definition at line 667 of file repos.c.

◆ dav_fs_getetag()

static const char * dav_fs_getetag ( const dav_resource resource)
static

Definition at line 1886 of file repos.c.

◆ dav_fs_insert_prop()

static dav_prop_insert dav_fs_insert_prop ( const dav_resource resource,
int  propid,
dav_prop_insert  what,
apr_text_header phdr 
)
static

< User protection bits

< Execute by user

<

Deprecated:
See also
APR_FPROT_UEXECUTE

Definition at line 1935 of file repos.c.

◆ dav_fs_internal_walk()

static dav_error * dav_fs_internal_walk ( const dav_walk_params params,
int  depth,
int  is_move,
const dav_resource root_dst,
dav_response **  response 
)
static

Definition at line 1793 of file repos.c.

◆ dav_fs_is_parent_resource()

static int dav_fs_is_parent_resource ( const dav_resource res1,
const dav_resource res2 
)
static

Definition at line 858 of file repos.c.

◆ dav_fs_is_same_resource()

static int dav_fs_is_same_resource ( const dav_resource res1,
const dav_resource res2 
)
static

< Inode

Definition at line 839 of file repos.c.

◆ dav_fs_is_writable()

static int dav_fs_is_writable ( const dav_resource resource,
int  propid 
)
static

Definition at line 2045 of file repos.c.

◆ dav_fs_mktemp()

static apr_status_t dav_fs_mktemp ( apr_file_t **  fp,
char templ,
apr_pool_t p 
)
static

< Open the file for writing

<

Deprecated:
See also
APR_FOPEN_WRITE

< Create the file if not there

<

Deprecated:
See also
APR_FOPEN_CREATE

< Open the file in binary mode (This flag is ignored on UNIX because it has no meaning)

<

Deprecated:
See also
APR_FOPEN_BINARY

< Open should fail if APR_FOPEN_CREATE and file exists.

<

Deprecated:
See also
APR_FOPEN_EXCL

< use OS's default permissions

<

Deprecated:
See also
APR_FPROT_OS_DEFAULT

Definition at line 888 of file repos.c.

◆ dav_fs_move_resource()

static dav_error * dav_fs_move_resource ( dav_resource src,
dav_resource dst,
dav_response **  response 
)
static

Definition at line 1317 of file repos.c.

◆ dav_fs_open_stream()

static dav_error * dav_fs_open_stream ( const dav_resource resource,
dav_stream_mode  mode,
dav_stream **  stream 
)
static

< Open the file for reading

<

Deprecated:
See also
APR_FOPEN_READ

< Open the file in binary mode (This flag is ignored on UNIX because it has no meaning)

<

Deprecated:
See also
APR_FOPEN_BINARY

< Open the file for writing

<

Deprecated:
See also
APR_FOPEN_WRITE

< Create the file if not there

<

Deprecated:
See also
APR_FOPEN_CREATE

< Open the file and truncate to 0 length

<

Deprecated:
See also
APR_FOPEN_TRUNCATE

< Open the file in binary mode (This flag is ignored on UNIX because it has no meaning)

<

Deprecated:
See also
APR_FOPEN_BINARY

< Open the file for writing

<

Deprecated:
See also
APR_FOPEN_WRITE

< Create the file if not there

<

Deprecated:
See also
APR_FOPEN_CREATE

< Open the file in binary mode (This flag is ignored on UNIX because it has no meaning)

<

Deprecated:
See also
APR_FOPEN_BINARY

< Open should fail if APR_FOPEN_CREATE and file exists.

< use OS's default permissions

<

Deprecated:
See also
APR_FPROT_OS_DEFAULT

< use OS's default permissions

<

Deprecated:
See also
APR_FPROT_OS_DEFAULT

< use OS's default permissions

<

Deprecated:
See also
APR_FPROT_OS_DEFAULT

Definition at line 908 of file repos.c.

◆ dav_fs_patch_commit()

static void dav_fs_patch_commit ( const dav_resource resource,
int  operation,
void *  context,
dav_liveprop_rollback rollback_ctx 
)
static

Definition at line 2162 of file repos.c.

◆ dav_fs_patch_exec()

static dav_error * dav_fs_patch_exec ( const dav_resource resource,
const apr_xml_elem elem,
int  operation,
void *  context,
dav_liveprop_rollback **  rollback_ctx 
)
static

< Execute by user

<

Deprecated:
See also
APR_FPROT_UEXECUTE

< Execute by user

<

Deprecated:
See also
APR_FPROT_UEXECUTE

< Execute by user

<

Deprecated:
See also
APR_FPROT_UEXECUTE

Definition at line 2125 of file repos.c.

◆ dav_fs_patch_rollback()

static dav_error * dav_fs_patch_rollback ( const dav_resource resource,
int  operation,
void *  context,
dav_liveprop_rollback rollback_ctx 
)
static

< Execute by user

<

Deprecated:
See also
APR_FPROT_UEXECUTE

< Execute by user

<

Deprecated:
See also
APR_FPROT_UEXECUTE

Definition at line 2170 of file repos.c.

◆ dav_fs_patch_validate()

static dav_error * dav_fs_patch_validate ( const dav_resource resource,
const apr_xml_elem elem,
int  operation,
void **  context,
int defer_to_dead 
)
static

Definition at line 2060 of file repos.c.

◆ dav_fs_remove_resource()

static dav_error * dav_fs_remove_resource ( dav_resource resource,
dav_response **  response 
)
static

Definition at line 1444 of file repos.c.

◆ dav_fs_seek_stream()

static dav_error * dav_fs_seek_stream ( dav_stream stream,
apr_off_t  abs_pos 
)
static

Definition at line 1038 of file repos.c.

◆ dav_fs_walk()

static dav_error * dav_fs_walk ( const dav_walk_params params,
int  depth,
dav_response **  response 
)
static

Definition at line 1877 of file repos.c.

◆ dav_fs_walker()

static dav_error * dav_fs_walker ( dav_fs_walker_context fsctx,
int  depth 
)
static

< an atomic unix apr_dir_read()

< Stat the link not the file itself if it is a link

< Type

< Inode

< Size of the file

< Creation or inode-changed time

< Modification Time

< all protections

Definition at line 1504 of file repos.c.

◆ dav_fs_write_stream()

static dav_error * dav_fs_write_stream ( dav_stream stream,
const void *  buf,
apr_size_t  bufsize 
)
static

Definition at line 1018 of file repos.c.

◆ tmpfile_cleanup()

static apr_status_t tmpfile_cleanup ( void *  data)
static

Definition at line 878 of file repos.c.

Variable Documentation

◆ aplog_module_index

int* const aplog_module_index = &( dav_fs_module.module_index)
static

Definition at line 38 of file repos.c.

◆ dav_fs_liveprop_group

const dav_liveprop_group dav_fs_liveprop_group
static
Initial value:
=
{
}
static const dav_liveprop_spec dav_fs_props[]
Definition repos.c:149
static const char *const dav_fs_namespace_uris[]
Definition repos.c:108
static const dav_hooks_liveprop dav_hooks_liveprop_fs
Definition repos.c:102

Definition at line 188 of file repos.c.

◆ dav_fs_namespace_uris

const char* const dav_fs_namespace_uris[]
static
Initial value:
=
{
"DAV:",
"http://apache.org/dav/props/",
}
return NULL
Definition mod_so.c:359

Definition at line 108 of file repos.c.

◆ dav_fs_props

const dav_liveprop_spec dav_fs_props[]
static

Definition at line 149 of file repos.c.

◆ dav_fs_provider

const dav_provider dav_fs_provider
static
Initial value:
=
{
NULL,
NULL,
NULL,
}
const dav_hooks_db dav_hooks_db_dbm
Definition dbm.c:784
const dav_hooks_locks dav_hooks_locks_fs
Definition lock.c:1426
static const dav_hooks_repository dav_hooks_repository_fs
Definition repos.c:101

Definition at line 2211 of file repos.c.

◆ dav_hooks_liveprop_fs

static const dav_hooks_liveprop dav_hooks_liveprop_fs
static
Initial value:
=
{
}
static dav_error * dav_fs_patch_rollback(const dav_resource *resource, int operation, void *context, dav_liveprop_rollback *rollback_ctx)
Definition repos.c:2170
static dav_prop_insert dav_fs_insert_prop(const dav_resource *resource, int propid, dav_prop_insert what, apr_text_header *phdr)
Definition repos.c:1935
static dav_error * dav_fs_patch_exec(const dav_resource *resource, const apr_xml_elem *elem, int operation, void *context, dav_liveprop_rollback **rollback_ctx)
Definition repos.c:2125
static int dav_fs_is_writable(const dav_resource *resource, int propid)
Definition repos.c:2045
static dav_error * dav_fs_patch_validate(const dav_resource *resource, const apr_xml_elem *elem, int operation, void **context, int *defer_to_dead)
Definition repos.c:2060
static void dav_fs_patch_commit(const dav_resource *resource, int operation, void *context, dav_liveprop_rollback *rollback_ctx)
Definition repos.c:2162

Definition at line 102 of file repos.c.

◆ dav_hooks_locks_fs

const dav_hooks_locks dav_hooks_locks_fs
extern

Definition at line 1426 of file lock.c.

◆ dav_hooks_repository_fs

static const dav_hooks_repository dav_hooks_repository_fs
static
Initial value:
=
{
0 ,
}
const char * dav_fs_pathname(const dav_resource *resource)
Definition repos.c:233
static dav_error * dav_fs_seek_stream(dav_stream *stream, apr_off_t abs_pos)
Definition repos.c:1038
static dav_error * dav_fs_walk(const dav_walk_params *params, int depth, dav_response **response)
Definition repos.c:1877
static dav_error * dav_fs_close_stream(dav_stream *stream, int commit)
Definition repos.c:983
static dav_error * dav_fs_get_parent_resource(const dav_resource *resource, dav_resource **result_parent)
Definition repos.c:773
static dav_error * dav_fs_write_stream(dav_stream *stream, const void *buf, apr_size_t bufsize)
Definition repos.c:1018
static const char * dav_fs_getetag(const dav_resource *resource)
Definition repos.c:1886
static int dav_fs_is_same_resource(const dav_resource *res1, const dav_resource *res2)
Definition repos.c:839
static int dav_fs_is_parent_resource(const dav_resource *res1, const dav_resource *res2)
Definition repos.c:858
static dav_error * dav_fs_copy_resource(const dav_resource *src, dav_resource *dst, int depth, dav_response **response)
Definition repos.c:1286
static request_rec * dav_fs_get_request_rec(const dav_resource *resource)
Definition repos.c:223
static dav_error * dav_fs_move_resource(dav_resource *src, dav_resource *dst, dav_response **response)
Definition repos.c:1317
static dav_error * dav_fs_get_resource(request_rec *r, const char *root_dir, const char *label, int use_checked_in, dav_resource **result_resource)
Definition repos.c:667
static dav_error * dav_fs_open_stream(const dav_resource *resource, dav_stream_mode mode, dav_stream **stream)
Definition repos.c:908
static dav_error * dav_fs_create_collection(dav_resource *resource)
Definition repos.c:1133
static dav_error * dav_fs_remove_resource(dav_resource *resource, dav_response **response)
Definition repos.c:1444

Definition at line 101 of file repos.c.