From ddfd4663dcd327963124b03567dbd1f0880d67f4 Mon Sep 17 00:00:00 2001
From: covener <covener@apache.org>
Date: Wed, 30 Nov 2022 2:24:32 AM GMT+0800
Subject: [PATCH] mod_dav:open the lock database read only when possible

Conflict:NA
Reference:https://github.com/apache/httpd/commit/ddfd4663dcd327963124b03567dbd1f0880d67f4

---
 modules/dav/main/mod_dav.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/modules/dav/main/mod_dav.c b/modules/dav/main/mod_dav.c
index 2cbfc06..76d9a51 100644
--- a/modules/dav/main/mod_dav.c
+++ b/modules/dav/main/mod_dav.c
@@ -1405,8 +1405,7 @@ static dav_error *dav_gen_supported_live_props(request_rec *r,
     dav_error *err;
 
     /* open lock database, to report on supported lock properties */
-    /* ### should open read-only */
-    if ((err = dav_open_lockdb(r, 0, &lockdb)) != NULL) {
+    if ((err = dav_open_lockdb(r, 1, &lockdb)) != NULL) {
         return dav_push_error(r->pool, err->status, 0,
                               "The lock database could not be opened, "
                               "preventing the reporting of supported lock "
@@ -2171,8 +2170,7 @@ static int dav_method_propfind(request_rec *r)
     apr_pool_create(&ctx.scratchpool, r->pool);
     apr_pool_tag(ctx.scratchpool, "mod_dav-scratch");
 
-    /* ### should open read-only */
-    if ((err = dav_open_lockdb(r, 0, &ctx.w.lockdb)) != NULL) {
+    if ((err = dav_open_lockdb(r, 1, &ctx.w.lockdb)) != NULL) {
         err = dav_push_error(r->pool, err->status, 0,
                              "The lock database could not be opened, "
                              "preventing access to the various lock "
-- 
2.27.0

