From 88b98fbe843b42ddfa514926fcf4bd05e7e8c24c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 28 Sep 2023 08:11:30 +0000 Subject: [PATCH 1/4] * modules/dav/fs/dbm.c (dav_dbm_open_direct): Test against APR_MAJOR_VERSION, APU_MAJOR_VERSION is not defined for APR trunk since the #include is conditional on APR < 2. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1912571 13f79535-47bb-0310-9956-ffa450edef68 (cherry picked from commit fb0ac6a5ec251dea9e27dfdc75521fe9d053cad9) --- modules/dav/fs/dbm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/dav/fs/dbm.c b/modules/dav/fs/dbm.c index 39ab4adc581..4753099409e 100644 --- a/modules/dav/fs/dbm.c +++ b/modules/dav/fs/dbm.c @@ -132,7 +132,7 @@ void dav_fs_ensure_state_dir(apr_pool_t * p, const char *dirname) dav_error * dav_dbm_open_direct(apr_pool_t *p, const char *pathname, int ro, dav_db **pdb) { -#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7) +#if APR_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7) const apr_dbm_driver_t *driver; const apu_err_t *err; #endif @@ -141,7 +141,7 @@ dav_error * dav_dbm_open_direct(apr_pool_t *p, const char *pathname, int ro, *pdb = NULL; -#if APU_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7) +#if APR_MAJOR_VERSION > 1 || (APU_MAJOR_VERSION == 1 && APU_MINOR_VERSION >= 7) if ((status = apr_dbm_get_driver(&driver, NULL, &err, p)) != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, status, ap_server_conf, APLOGNO(10289) "mod_dav_fs: The DBM library '%s' could not be loaded: %s", From 7ca97c121107b779d7e9a2d9bfcb6d0298871e22 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Tue, 3 Oct 2023 12:58:16 +0000 Subject: [PATCH 2/4] mod_dav_fs: add DAVLockDBType directive. * modules/dav/fs/dbm.c (dav_dbm_open_direct): Take a dbmtype argument and use it to select the apr_dbm driver type. (dav_dbm_open): Continue to use the "default" propdb type to open the property databases. * modules/dav/fs/lock.c: Store and pass through the lockdb_type through. * modules/dav/fs/mod_dav_fs.c (dav_get_lockdb_path): Return the dbm type via an output argument. (dav_fs_cmd_davlockdbtype): New config directive. (dav_fs_merge_server_config): Merge the dbm type. (dav_fs_post_config): Set the default lockdb type. * modules/dav/fs/repos.h: Update prototypes as above; internal API only so no compat concerns. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1912718 13f79535-47bb-0310-9956-ffa450edef68 (cherry picked from commit afcdbeebbff4b0c50ea26cdd16e178c0d1f24152) --- changes-entries/davlockdbtype.txt | 1 + docs/manual/mod/mod_dav_fs.xml | 26 ++++++++++++--- modules/dav/fs/dbm.c | 22 +++++++------ modules/dav/fs/lock.c | 4 ++- modules/dav/fs/mod_dav_fs.c | 54 +++++++++++++++++++++++++++++-- modules/dav/fs/repos.h | 9 +++--- 6 files changed, 96 insertions(+), 20 deletions(-) create mode 100644 changes-entries/davlockdbtype.txt diff --git a/changes-entries/davlockdbtype.txt b/changes-entries/davlockdbtype.txt new file mode 100644 index 00000000000..d83fd333745 --- /dev/null +++ b/changes-entries/davlockdbtype.txt @@ -0,0 +1 @@ + *) mod_dav_fs: Add DavLockDBType directive. [Joe Orton] diff --git a/docs/manual/mod/mod_dav_fs.xml b/docs/manual/mod/mod_dav_fs.xml index 9d21462d118..f6c94f60e5d 100644 --- a/docs/manual/mod/mod_dav_fs.xml +++ b/docs/manual/mod/mod_dav_fs.xml @@ -58,11 +58,12 @@

Use the DavLockDB directive to specify - the full path to the lock database, excluding an extension. If - the path is not absolute, it will be taken relative to ServerRoot. The implementation of - mod_dav_fs uses a SDBM database to track user - locks.

+ mod_dav_fs uses a database to track user + locks. The type of database file can be changed using + DavLockDBType.