From 8433a9b8c9127929ec6e974a3dec7a8f95628032 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Sun, 18 Apr 2021 19:40:13 +0000 Subject: Merge r1730128, r1878140, r1878265, r1881736, r1882775, r1883872, r1884509, r1887720 from trunk *) Easy patches: synch 2.4.x and trunk - doxygen: Correct doxygen groupname - .gdbinit: align columns - .gdbinit: fix indentation - mod_dav: Add specific logs for different modes - core: ap_pbase64encode(): save double NUL byte allocation and assignment - core: ap_pbase64decode(): save double NUL byte allocation and assignment - support: Fix a typo in a comment - proxy_util.c: Fix leak in error path in the do_malloc case Submitted by: wrowe, ylavic, ylavic, jorton, rpluem, ylavic, jorton, jorton Reviewed by: jailletc36, gbechis, ylavic Backported by: jailletc36 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1888929 13f79535-47bb-0310-9956-ffa450edef68 --- modules/dav/fs/repos.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'modules/dav') diff --git a/modules/dav/fs/repos.c b/modules/dav/fs/repos.c index 8dfa28a34f..1f7379a4d3 100644 --- a/modules/dav/fs/repos.c +++ b/modules/dav/fs/repos.c @@ -948,15 +948,29 @@ static dav_error * dav_fs_open_stream(const dav_resource *resource, else if (APR_STATUS_IS_EEXIST(rv)) { rv = apr_file_open(&ds->f, ds->pathname, flags, APR_OS_DEFAULT, ds->p); + if (rv != APR_SUCCESS) { + return dav_new_error(p, MAP_IO2HTTP(rv), 0, rv, + apr_psprintf(p, "Could not open an existing " + "resource for writing: %s.", + ds->pathname)); + } } } else { rv = apr_file_open(&ds->f, ds->pathname, flags, APR_OS_DEFAULT, ds->p); + if (rv != APR_SUCCESS) { + return dav_new_error(p, MAP_IO2HTTP(rv), 0, rv, + apr_psprintf(p, "Could not open an existing " + "resource for reading: %s.", + ds->pathname)); + } } if (rv != APR_SUCCESS) { return dav_new_error(p, MAP_IO2HTTP(rv), 0, rv, - "An error occurred while opening a resource."); + apr_psprintf(p, "An error occurred while opening " + "a resource for writing: %s.", + ds->pathname)); } /* (APR registers cleanups for the fd with the pool) */ -- cgit v1.2.1