Apache HTTPD
dbm.c
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/*
18** DAV extension module for Apache 2.0.*
19** - Database support using DBM-style databases,
20** part of the filesystem repository implementation
21*/
22
23/*
24** This implementation uses a SDBM database per file and directory to
25** record the properties. These databases are kept in a subdirectory (of
26** the directory in question or the directory that holds the file in
27** question) named by the macro DAV_FS_STATE_DIR (.DAV). The filename of the
28** database is equivalent to the target filename, and is
29** DAV_FS_STATE_FILE_FOR_DIR (.state_for_dir) for the directory itself.
30*/
31
32#include "apr_strings.h"
33#include "apr_file_io.h"
34
35#include "apr_dbm.h"
36
37#define APR_WANT_BYTEFUNC
38#include "apr_want.h" /* for ntohs and htons */
39
40#include "apr_version.h"
41#if !APR_VERSION_AT_LEAST(2,0,0)
42#include "apu_version.h"
43#endif
44
45#include "mod_dav.h"
46#include "repos.h"
47#include "http_log.h"
48#include "http_main.h" /* for ap_server_conf */
49
51
52struct dav_db {
55
56 /* when used as a property database: */
57
58 int version; /* *minor* version of this db */
59
60 dav_buffer ns_table; /* table of namespace URIs */
61 short ns_count; /* number of entries in table */
62 int ns_table_dirty; /* ns_table was modified */
63 apr_hash_t *uri_index; /* map URIs to (1-based) table indices */
64
65 dav_buffer wb_key; /* work buffer for dav_gdbm_key */
66
67 apr_datum_t iter; /* iteration key */
68};
69
70/* -------------------------------------------------------------------------
71 *
72 * GENERIC DBM ACCESS
73 *
74 * For the most part, this just uses the APR DBM functions. They are wrapped
75 * a bit with some error handling (using the mod_dav error functions).
76 */
77
79 const char **state1, const char **state2)
80{
81 if (fname == NULL)
83
85}
86
89{
90 int errcode;
91 const char *errstr;
93 char errbuf[200];
94
95 if (status == APR_SUCCESS)
96 return NULL;
97
98 p = db ? db->pool : p;
99
100 /* There might not be a <db> if we had problems creating it. */
101 if (db == NULL) {
102 errcode = 1;
103 errstr = "Could not open property database.";
106 "The DBM driver could not be loaded");
107 }
108 else {
109 (void) apr_dbm_geterror(db->file, &errcode, errbuf, sizeof(errbuf));
110 errstr = apr_pstrdup(p, errbuf);
111 }
112
114 return err;
115}
116
117/* ensure that our state subdirectory is present */
118/* ### does this belong here or in dav_fs_repos.c ?? */
120{
121 const char *pathname = apr_pstrcat(p, dirname, "/" DAV_FS_STATE_DIR, NULL);
122
123 /* ### do we need to deal with the umask? */
124
125 /* just try to make it, ignoring any resulting errors */
127}
128
129/* dav_dbm_open_direct: Opens a *dbm database specified by path.
130 * ro = boolean read-only flag.
131 */
133 dav_db **pdb)
134{
135#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7)
137 const apu_err_t *err;
138#endif
141
142 *pdb = NULL;
143
144#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7)
147 "mod_dav_fs: The DBM library '%s' could not be loaded: %s",
148 err->reason, err->msg);
150 "Could not load library for property database.");
151 }
155 != APR_SUCCESS && !ro) {
156 return dav_fs_dbm_error(NULL, p, status);
157 }
158#else
162 != APR_SUCCESS
163 && !ro) {
164 /* ### do something with 'status' */
165
166 /* we can't continue if we couldn't open the file
167 and we need to write */
168 return dav_fs_dbm_error(NULL, p, status);
169 }
170#endif
171
172 /* may be NULL if we tried to open a non-existent db as read-only */
173 if (file != NULL) {
174 /* we have an open database... return it */
175 *pdb = apr_pcalloc(p, sizeof(**pdb));
176 (*pdb)->pool = p;
177 (*pdb)->file = file;
178 }
179
180 return NULL;
181}
182
184 int ro, dav_db **pdb)
185{
186 const char *dirpath;
187 const char *fname;
188 const char *pathname;
189
190 /* Get directory and filename for resource */
191 /* ### should test this result value... */
193
194 /* If not opening read-only, ensure the state dir exists */
195 if (!ro) {
196 /* ### what are the perf implications of always checking this? */
198 }
199
202 NULL);
203
204 /* ### readers cannot open while a writer has this open; we should
205 ### perform a few retries with random pauses. */
206
207 /* ### do we need to deal with the umask? */
208
209 return dav_dbm_open_direct(p, pathname, ro, pdb);
210}
211
213{
214 apr_dbm_close(db->file);
215}
216
218{
220
221 if (!key.dptr) {
222 /* no key could be created (namespace not known) => no value */
223 memset(pvalue, 0, sizeof(*pvalue));
225 } else {
227 }
228
229 return dav_fs_dbm_error(db, NULL, status);
230}
231
238
245
247{
248 return apr_dbm_exists(db->file, key);
249}
250
257
264
269
270/* -------------------------------------------------------------------------
271 *
272 * PROPERTY DATABASE FUNCTIONS
273 */
274
275
276#define DAV_GDBM_NS_KEY "METADATA"
277#define DAV_GDBM_NS_KEY_LEN 8
278
279typedef struct {
280 unsigned char major;
281#define DAV_DBVSN_MAJOR 4
282 /*
283 ** V4 -- 0.9.9 ..
284 ** Prior versions could have keys or values with invalid
285 ** namespace prefixes as a result of the xmlns="" form not
286 ** resetting the default namespace to be "no namespace". The
287 ** namespace would be set to "" which is invalid; it should
288 ** be set to "no namespace".
289 **
290 ** V3 -- 0.9.8
291 ** Prior versions could have values with invalid namespace
292 ** prefixes due to an incorrect mapping of input to propdb
293 ** namespace indices. Version bumped to obsolete the old
294 ** values.
295 **
296 ** V2 -- 0.9.7
297 ** This introduced the xml:lang value into the property value's
298 ** record in the propdb.
299 **
300 ** V1 -- .. 0.9.6
301 ** Initial version.
302 */
303
304
305 unsigned char minor;
306#define DAV_DBVSN_MINOR 0
307
308 short ns_count;
309
311
316
318 int *ns_map;
319};
320
321/*
322** Internal function to build a key
323**
324** WARNING: returns a pointer to a "static" buffer holding the key. The
325** value must be copied or no longer used if this function is
326** called again.
327*/
329{
330 char nsbuf[20];
331 apr_size_t l_ns, l_name = strlen(name->name);
332 apr_datum_t key = { 0 };
333
334 /*
335 * Convert namespace ID to a string. "no namespace" is an empty string,
336 * so the keys will have the form ":name". Otherwise, the keys will
337 * have the form "#:name".
338 */
339 if (*name->ns == '\0') {
340 nsbuf[0] = '\0';
341 l_ns = 0;
342 }
343 else {
344 long ns_id = (long)apr_hash_get(db->uri_index, name->ns,
346
347
348 if (ns_id == 0) {
349 /* the namespace was not found(!) */
350 return key; /* zeroed */
351 }
352
353 l_ns = apr_snprintf(nsbuf, sizeof(nsbuf), "%ld", ns_id - 1);
354 }
355
356 /* assemble: #:name */
357 dav_set_bufsize(db->pool, &db->wb_key, l_ns + 1 + l_name + 1);
358 memcpy(db->wb_key.buf, nsbuf, l_ns);
359 db->wb_key.buf[l_ns] = ':';
360 memcpy(&db->wb_key.buf[l_ns + 1], name->name, l_name + 1);
361
362 /* build the database key */
363 key.dsize = l_ns + 1 + l_name + 1;
364 key.dptr = db->wb_key.buf;
365
366 return key;
367}
368
370 const char *name, const char *value,
372{
373 const char *s;
374 const char *lang = value;
375
376 /* skip past the xml:lang value */
377 value += strlen(lang) + 1;
378
379 if (*value == '\0') {
380 /* the property is an empty value */
381 if (*name == ':') {
382 /* "no namespace" case */
383 s = apr_pstrcat(pool, "<", name+1, "/>" DEBUG_CR, NULL);
384 }
385 else {
386 s = apr_pstrcat(pool, "<ns", name, "/>" DEBUG_CR, NULL);
387 }
388 }
389 else if (*lang != '\0') {
390 if (*name == ':') {
391 /* "no namespace" case */
392 s = apr_pstrcat(pool, "<", name+1, " xml:lang=\"",
393 lang, "\">", value, "</", name+1, ">" DEBUG_CR,
394 NULL);
395 }
396 else {
397 s = apr_pstrcat(pool, "<ns", name, " xml:lang=\"",
398 lang, "\">", value, "</ns", name, ">" DEBUG_CR,
399 NULL);
400 }
401 }
402 else if (*name == ':') {
403 /* "no namespace" case */
404 s = apr_pstrcat(pool, "<", name+1, ">", value, "</", name+1, ">"
405 DEBUG_CR, NULL);
406 }
407 else {
408 s = apr_pstrcat(pool, "<ns", name, ">", value, "</ns", name, ">"
409 DEBUG_CR, NULL);
410 }
411
413}
414
416 const dav_resource *resource, int ro,
417 dav_db **pdb)
418{
419 dav_db *db;
420 dav_error *err;
422 apr_datum_t value = { 0 };
423
424 *pdb = NULL;
425
426 /*
427 ** Return if an error occurred, or there is no database.
428 **
429 ** NOTE: db could be NULL if we attempted to open a readonly
430 ** database that doesn't exist. If we require read/write
431 ** access, then a database was created and opened.
432 */
433 if ((err = dav_dbm_open(pool, resource, ro, &db)) != NULL
434 || db == NULL)
435 return err;
436
438
439 key.dptr = DAV_GDBM_NS_KEY;
440 key.dsize = DAV_GDBM_NS_KEY_LEN;
441 if ((err = dav_dbm_fetch(db, key, &value)) != NULL) {
442 /* ### push a higher-level description? */
443 return err;
444 }
445
446 if (value.dptr == NULL) {
449 };
450
451 /*
452 ** If there is no METADATA key, then the database may be
453 ** from versions 0.9.0 .. 0.9.4 (which would be incompatible).
454 ** These can be identified by the presence of an NS_TABLE entry.
455 */
456 key.dptr = "NS_TABLE";
457 key.dsize = 8;
458 if (dav_dbm_exists(db, key)) {
459 dav_dbm_close(db);
460
461 /* call it a major version error */
464 "Prop database has the wrong major "
465 "version number and cannot be used.");
466 }
467
468 /* initialize a new metadata structure */
469 dav_set_bufsize(pool, &db->ns_table, sizeof(m));
470 memcpy(db->ns_table.buf, &m, sizeof(m));
471 }
472 else {
474 long ns;
475 const char *uri;
476
477 dav_set_bufsize(pool, &db->ns_table, value.dsize);
478 memcpy(db->ns_table.buf, value.dptr, value.dsize);
479
480 memcpy(&m, value.dptr, sizeof(m));
481 if (m.major != DAV_DBVSN_MAJOR) {
482 dav_dbm_close(db);
483
486 "Prop database has the wrong major "
487 "version number and cannot be used.");
488 }
489 db->version = m.minor;
490 db->ns_count = ntohs(m.ns_count);
491
493
494 /* create db->uri_index */
495 for (ns = 0, uri = db->ns_table.buf + sizeof(dav_propdb_metadata);
496 ns++ < db->ns_count;
497 uri += strlen(uri) + 1) {
498
499 /* we must copy the key, in case ns_table.buf moves */
502 (void *)ns);
503 }
504 }
505
506 *pdb = db;
507 return NULL;
508}
509
510static void dav_propdb_close(dav_db *db)
511{
512
513 if (db->ns_table_dirty) {
517 dav_error *err;
518
519 key.dptr = DAV_GDBM_NS_KEY;
520 key.dsize = DAV_GDBM_NS_KEY_LEN;
521
522 value.dptr = db->ns_table.buf;
523 value.dsize = db->ns_table.cur_len;
524
525 /* fill in the metadata that we store into the prop db. */
526 m.major = DAV_DBVSN_MAJOR;
527 m.minor = db->version; /* ### keep current minor version? */
528 m.ns_count = htons(db->ns_count);
529
530 memcpy(db->ns_table.buf, &m, sizeof(m));
531
532 err = dav_dbm_store(db, key, value);
533 if (err != NULL)
535 APLOGNO(00577) "Error writing propdb: %s", err->desc);
536 }
537
538 dav_dbm_close(db);
539}
540
542{
543 int ns;
544 const char *uri = db->ns_table.buf + sizeof(dav_propdb_metadata);
545
546 /* within the prop values, we use "ns%d" for prefixes... register them */
547 for (ns = 0; ns < db->ns_count; ++ns, uri += strlen(uri) + 1) {
548
549 /* Empty URIs signify the empty namespace. These do not get a
550 namespace prefix. when we generate the value, we will simply
551 leave off the prefix, which is defined by mod_dav to be the
552 empty namespace. */
553 if (*uri == '\0')
554 continue;
555
556 /* ns_table.buf can move, so copy its value (we want the values to
557 last as long as the provided dav_xmlns_info). */
559 apr_psprintf(xi->pool, "ns%d", ns),
560 apr_pstrdup(xi->pool, uri));
561 }
562
563 return NULL;
564}
565
567 const dav_prop_name *name,
570 int *found)
571{
574 dav_error *err;
575
576 if ((err = dav_dbm_fetch(db, key, &value)) != NULL)
577 return err;
578 if (value.dptr == NULL) {
579 *found = 0;
580 return NULL;
581 }
582 *found = 1;
583
584 dav_append_prop(db->pool, key.dptr, value.dptr, phdr);
585
587
588 return NULL;
589}
590
592 dav_db *db,
594 dav_namespace_map **mapping)
595{
596 dav_namespace_map *m = apr_palloc(db->pool, sizeof(*m));
597 int i;
598 int *pmap;
599 const char **puri;
600
601 /*
602 ** Iterate over the provided namespaces. If a namespace already appears
603 ** in our internal map of URI -> ns_id, then store that in the map. If
604 ** we don't know the namespace yet, then add it to the map and to our
605 ** table of known namespaces.
606 */
607 m->ns_map = pmap = apr_palloc(db->pool, namespaces->nelts * sizeof(*pmap));
608 for (i = namespaces->nelts, puri = (const char **)namespaces->elts;
609 i-- > 0;
610 ++puri, ++pmap) {
611
612 const char *uri = *puri;
613 apr_size_t uri_len = strlen(uri);
614 long ns_id = (long)apr_hash_get(db->uri_index, uri, uri_len);
615
616 if (ns_id == 0) {
617 dav_check_bufsize(db->pool, &db->ns_table, uri_len + 1);
618 memcpy(db->ns_table.buf + db->ns_table.cur_len, uri, uri_len + 1);
619 db->ns_table.cur_len += uri_len + 1;
620
621 /* copy the uri in case the passed-in namespaces changes in
622 some way. */
623 apr_hash_set(db->uri_index, apr_pstrdup(db->pool, uri), uri_len,
624 (void *)((long)(db->ns_count + 1)));
625
626 db->ns_table_dirty = 1;
627
628 *pmap = db->ns_count++;
629 }
630 else {
631 *pmap = ns_id - 1;
632 }
633 }
634
635 *mapping = m;
636 return NULL;
637}
638
640 const apr_xml_elem *elem,
641 dav_namespace_map *mapping)
642{
645
646 /* Note: mapping->ns_map was set up in dav_propdb_map_namespaces() */
647
648 /* ### use a db- subpool for these values? clear on exit? */
649
650 /* quote all the values in the element */
651 /* ### be nice to do this without affecting the element itself */
652 /* ### of course, the cast indicates Badness is occurring here */
654
655 /* generate a text blob for the xml:lang plus the contents */
657 mapping->ns_map,
658 (const char **)&value.dptr, &value.dsize);
659
660 return dav_dbm_store(db, key, value);
661}
662
664{
666 return dav_dbm_delete(db, key);
667}
668
670{
672 return dav_dbm_exists(db, key);
673}
674
675static const char *dav_get_ns_table_uri(dav_db *db, int ns_id)
676{
677 const char *p = db->ns_table.buf + sizeof(dav_propdb_metadata);
678
679 while (ns_id--)
680 p += strlen(p) + 1;
681
682 return p;
683}
684
685static void dav_set_name(dav_db *db, dav_prop_name *pname)
686{
687 const char *s = db->iter.dptr;
688
689 if (s == NULL) {
690 pname->ns = pname->name = NULL;
691 }
692 else if (*s == ':') {
693 pname->ns = "";
694 pname->name = s + 1;
695 }
696 else {
697 int id = atoi(s);
698
699 pname->ns = dav_get_ns_table_uri(db, id);
700 if (s[1] == ':') {
701 pname->name = s + 2;
702 }
703 else {
704 pname->name = ap_strchr_c(s + 2, ':') + 1;
705 }
706 }
707}
708
710{
711 dav_error *err;
712
713 /* free the previous key. note: if the loop is aborted, then the DBM
714 will toss the key (via pool cleanup) */
715 if (db->iter.dptr != NULL)
716 dav_dbm_freedatum(db, db->iter);
717
718 if ((err = dav_dbm_nextkey(db, &db->iter)) != NULL)
719 return err;
720
721 /* skip past the METADATA key */
722 if (db->iter.dptr != NULL && *db->iter.dptr == 'M')
723 return dav_propdb_next_name(db, pname);
724
725 dav_set_name(db, pname);
726 return NULL;
727}
728
730{
731 dav_error *err;
732
733 if ((err = dav_dbm_firstkey(db, &db->iter)) != NULL)
734 return err;
735
736 /* skip past the METADATA key */
737 if (db->iter.dptr != NULL && *db->iter.dptr == 'M')
738 return dav_propdb_next_name(db, pname);
739
740 dav_set_name(db, pname);
741 return NULL;
742}
743
745 const dav_prop_name *name,
747{
748 dav_deadprop_rollback *rb = apr_pcalloc(db->pool, sizeof(*rb));
751 dav_error *err;
752
753 key = dav_build_key(db, name);
754 rb->key.dptr = apr_pstrdup(db->pool, key.dptr);
755 rb->key.dsize = key.dsize;
756
757 if ((err = dav_dbm_fetch(db, key, &value)) != NULL)
758 return err;
759 if (value.dptr != NULL) {
760 rb->value.dptr = apr_pmemdup(db->pool, value.dptr, value.dsize);
761 rb->value.dsize = value.dsize;
762 }
763
764 *prollback = rb;
765 return NULL;
766}
767
769 dav_deadprop_rollback *rollback)
770{
771 if (!rollback) {
772 return NULL; /* no rollback, nothing to do */
773 }
774
775 if (rollback->value.dptr == NULL) {
776 /* don't fail if the thing isn't really there. */
777 (void) dav_dbm_delete(db, rollback->key);
778 return NULL;
779 }
780
781 return dav_dbm_store(db, rollback->key, rollback->value);
782}
783
const ap_regex_t char * errbuf
Definition ap_regex.h:198
APR-UTIL DBM library.
APR File I/O Handling.
APR Strings library.
APR Versioning Interface.
APR Standard Headers Support.
APR-util Versioning Interface.
return found
Definition core.c:2840
static void dav_append_prop(apr_pool_t *pool, const char *name, const char *value, apr_text_header *phdr)
Definition dbm.c:369
static void dav_set_name(dav_db *db, dav_prop_name *pname)
Definition dbm.c:685
static dav_error * dav_propdb_map_namespaces(dav_db *db, const apr_array_header_t *namespaces, dav_namespace_map **mapping)
Definition dbm.c:591
static dav_error * dav_fs_dbm_error(dav_db *db, apr_pool_t *p, apr_status_t status)
Definition dbm.c:87
static dav_error * dav_propdb_store(dav_db *db, const dav_prop_name *name, const apr_xml_elem *elem, dav_namespace_map *mapping)
Definition dbm.c:639
static dav_error * dav_propdb_apply_rollback(dav_db *db, dav_deadprop_rollback *rollback)
Definition dbm.c:768
static dav_error * dav_dbm_open(apr_pool_t *p, const dav_resource *resource, int ro, dav_db **pdb)
Definition dbm.c:183
static const char * dav_get_ns_table_uri(dav_db *db, int ns_id)
Definition dbm.c:675
#define DAV_DBVSN_MAJOR
Definition dbm.c:281
static dav_error * dav_propdb_next_name(dav_db *db, dav_prop_name *pname)
Definition dbm.c:709
static dav_error * dav_dbm_firstkey(dav_db *db, apr_datum_t *pkey)
Definition dbm.c:251
static dav_error * dav_propdb_open(apr_pool_t *pool, const dav_resource *resource, int ro, dav_db **pdb)
Definition dbm.c:415
#define DAV_DBVSN_MINOR
Definition dbm.c:306
static dav_error * dav_propdb_get_rollback(dav_db *db, const dav_prop_name *name, dav_deadprop_rollback **prollback)
Definition dbm.c:744
static dav_error * dav_propdb_remove(dav_db *db, const dav_prop_name *name)
Definition dbm.c:663
static dav_error * dav_propdb_define_namespaces(dav_db *db, dav_xmlns_info *xi)
Definition dbm.c:541
static dav_error * dav_dbm_nextkey(dav_db *db, apr_datum_t *pkey)
Definition dbm.c:258
#define DAV_GDBM_NS_KEY_LEN
Definition dbm.c:277
#define DAV_GDBM_NS_KEY
Definition dbm.c:276
static void dav_propdb_close(dav_db *db)
Definition dbm.c:510
static dav_error * dav_propdb_output_value(dav_db *db, const dav_prop_name *name, dav_xmlns_info *xi, apr_text_header *phdr, int *found)
Definition dbm.c:566
static apr_datum_t dav_build_key(dav_db *db, const dav_prop_name *name)
Definition dbm.c:328
static dav_error * dav_propdb_first_name(dav_db *db, dav_prop_name *pname)
Definition dbm.c:729
static int dav_propdb_exists(dav_db *db, const dav_prop_name *name)
Definition dbm.c:669
#define APLOG_USE_MODULE(foo)
#define APLOGNO(n)
Definition http_log.h:117
#define APLOG_ERR
Definition http_log.h:67
#define ap_log_error
Definition http_log.h:370
#define APLOG_MARK
Definition http_log.h:283
#define APLOG_WARNING
Definition http_log.h:68
#define APLOG_CRIT
Definition http_log.h:66
server_rec * ap_server_conf
Definition config.c:62
#define APR_STATUS_IS_EDSOOPEN(s)
Definition apr_errno.h:403
const char const apr_dbd_driver_t ** driver
Definition apr_dbd.h:106
int * errcode
Definition apr_dbm.h:183
apr_datum_t * pkey
Definition apr_dbm.h:158
apr_datum_t apr_datum_t * pvalue
Definition apr_dbm.h:128
#define APR_DBM_RWCREATE
Definition apr_dbm.h:58
#define APR_DBM_READONLY
Definition apr_dbm.h:56
const char const char * pathname
Definition apr_dbm.h:201
void ** resource
const char * uri
Definition apr_uri.h:159
#define APR_XML_X2T_LANG_INNER
Definition apr_xml.h:294
const apr_xml_elem int apr_array_header_t * namespaces
Definition apr_xml.h:287
#define HTTP_INTERNAL_SERVER_ERROR
Definition httpd.h:535
dav_error * dav_dbm_store(dav_db *db, apr_datum_t key, apr_datum_t value)
Definition dbm.c:232
void dav_fs_ensure_state_dir(apr_pool_t *p, const char *dirname)
Definition dbm.c:119
dav_error * dav_dbm_delete(dav_db *db, apr_datum_t key)
Definition dbm.c:239
const dav_hooks_db dav_hooks_db_dbm
Definition dbm.c:784
void dav_dbm_freedatum(dav_db *db, apr_datum_t data)
Definition dbm.c:265
dav_error * dav_dbm_fetch(dav_db *db, apr_datum_t key, apr_datum_t *pvalue)
Definition dbm.c:217
#define DAV_FS_STATE_FILE_FOR_DIR
Definition repos.h:30
int dav_dbm_exists(dav_db *db, apr_datum_t key)
Definition dbm.c:246
dav_error * dav_fs_dir_file_name(const dav_resource *resource, const char **dirpath_p, const char **fname_p)
Definition repos.c:238
#define DEBUG_CR
Definition mod_dav.h:65
void dav_dbm_close(dav_db *db)
Definition dbm.c:212
void dav_dbm_get_statefiles(apr_pool_t *p, const char *fname, const char **state1, const char **state2)
Definition dbm.c:78
#define DAV_ERR_PROP_BAD_MAJOR
Definition mod_dav.h:217
void dav_check_bufsize(apr_pool_t *p, dav_buffer *pbuf, apr_size_t extra_needed)
Definition util.c:107
void dav_xmlns_add(dav_xmlns_info *xi, const char *prefix, const char *uri)
Definition util.c:473
dav_error * dav_dbm_open_direct(apr_pool_t *p, const char *pathname, int ro, dav_db **pdb)
Definition dbm.c:132
#define DAV_FS_STATE_DIR
Definition repos.h:29
void dav_set_bufsize(apr_pool_t *p, dav_buffer *pbuf, apr_size_t size)
Definition util.c:122
dav_error * dav_new_error(apr_pool_t *p, int status, int error_id, apr_status_t aprerr, const char *desc)
Definition util.c:36
#define ap_strchr_c(s, c)
Definition httpd.h:2353
apr_size_t size
const char int apr_pool_t * pool
Definition apr_cstr.h:84
const char * dirname
const char * value
Definition apr_env.h:51
#define APR_SUCCESS
Definition apr_errno.h:225
int apr_status_t
Definition apr_errno.h:44
const char * key
void * data
const char apr_file_t * file
#define APR_OS_DEFAULT
const char * fname
#define APR_HASH_KEY_STRING
Definition apr_hash.h:47
#define apr_pcalloc(p, size)
Definition apr_pools.h:465
const char * s
Definition apr_strings.h:95
const void * m
apr_int32_t apr_int32_t apr_int32_t err
int int status
Apache Logging library.
Command line options.
apr_pool_t * p
Definition md_event.c:32
DAV extension module for Apache 2.0.*.
return NULL
Definition mod_so.c:359
int i
Definition mod_so.c:347
Declarations for the filesystem repository implementation.
char * name
char * dptr
Definition apr_dbm.h:50
apr_size_t cur_len
Definition mod_dav.h:447
char * buf
Definition mod_dav.h:448
Definition dbm.c:52
dav_buffer wb_key
Definition dbm.c:65
int version
Definition dbm.c:58
dav_buffer ns_table
Definition dbm.c:60
int ns_table_dirty
Definition dbm.c:62
short ns_count
Definition dbm.c:61
apr_dbm_t * file
Definition dbm.c:54
apr_datum_t iter
Definition dbm.c:67
apr_pool_t * pool
Definition dbm.c:53
apr_hash_t * uri_index
Definition dbm.c:63
apr_datum_t key
Definition dbm.c:313
apr_datum_t value
Definition dbm.c:314
int * ns_map
Definition dbm.c:318
const char * ns
Definition mod_dav.h:1200
const char * name
Definition mod_dav.h:1201
unsigned char minor
Definition dbm.c:305
unsigned char major
Definition dbm.c:280
apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *pool)
Definition dir.c:297
#define ns(x)
Definition xmltok.c:1644