Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.4 mod_dav_fs: add DAVLockDBType and add global mutex around lockdb use #399

Open
wants to merge 5 commits into
base: 2.4.x
Choose a base branch
from

Commits on Dec 8, 2023

  1. * modules/dav/fs/dbm.c (dav_fs_dbm_error, dav_dbm_open_direct): Remove

      error message references to "property" databases since these
      functions are used for both propdbs and the lock database.
    
    git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1912477 13f79535-47bb-0310-9956-ffa450edef68
    (cherry picked from commit c6d7943)
    notroj committed Dec 8, 2023
    Configuration menu
    Copy the full SHA
    bc396f5 View commit details
    Browse the repository at this point in the history
  2. * 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 <apu_version.h> 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 fb0ac6a)
    notroj committed Dec 8, 2023
    Configuration menu
    Copy the full SHA
    e394f92 View commit details
    Browse the repository at this point in the history
  3. 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 afcdbee)
    notroj committed Dec 8, 2023
    Configuration menu
    Copy the full SHA
    9660fb1 View commit details
    Browse the repository at this point in the history
  4. mod_dav_fs: Add global mutex around use of lockdb use, since

    apr_dbm does not provide thread-safe locking:
    
    * modules/dav/fs/mod_dav_fs.c (dav_fs_get_server_conf):
      Replaces dav_get_lockdb_path.
      (dav_fs_pre_config, dav_fs_child_init): New hooks.
      (dav_fs_post_config): Create & store the mutex here.
      (register_hooks): Register new hooks.
    
    * modules/dav/fs/repos.h: Expose new dav_fs_server_conf struct.
    
    * modules/dav/fs/lock.c (dav_fs_lockdb_cleanup): New cleanup
      which unlocks and closes the dbm handle.
      (dav_fs_really_open_lockdb): Lock the mutex here, register a
      cleanup.
      (dav_fs_open_lockdb): Adjust to use dav_fs_get_server_conf.
      (dav_fs_close_lockdb): Run the cleanup here.
    
    git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1914438 13f79535-47bb-0310-9956-ffa450edef68
    (cherry picked from commit 455147a)
    notroj committed Dec 8, 2023
    Configuration menu
    Copy the full SHA
    e26b7ea View commit details
    Browse the repository at this point in the history
  5. * modules/dav/fs/mod_dav_fs.c (dav_fs_post_config): Make safe for

      2.4.x without ap_state_dir_relative.
    notroj committed Dec 8, 2023
    Configuration menu
    Copy the full SHA
    abf2002 View commit details
    Browse the repository at this point in the history