Package: subversion / 1.10.4-1+deb10u1

0016-In-svnserve-consistently-handle-errors-in-opening-a-.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From: Julian Foad <julianfoad@apache.org>
Date: Mon, 10 Jun 2019 12:02:23 -0400
Subject: In svnserve, consistently handle errors in opening a repository.

These errors are still logged and reported to the client, as they were
before, but now it is done in the same way as everywhere else. (The error
logging now happens higher up the call stack.)

* subversion/svnserve/serve.c
  After reporting an error to the client, don't log it explicity here and
  then clear it; instead return it so the caller can do so.

Signed-off-by: James McCoy <jamessan@debian.org>
---
 subversion/svnserve/serve.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/subversion/svnserve/serve.c b/subversion/svnserve/serve.c
index 97097e3..1fe27b2 100644
--- a/subversion/svnserve/serve.c
+++ b/subversion/svnserve/serve.c
@@ -4114,7 +4114,7 @@ construct_server_baton(server_baton_t **baton,
                        serve_params_t *params,
                        apr_pool_t *scratch_pool)
 {
-  svn_error_t *err, *io_err;
+  svn_error_t *err;
   apr_uint64_t ver;
   const char *client_url, *ra_client_string, *client_string;
   svn_ra_svn__list_t *caplist;
@@ -4252,11 +4252,12 @@ construct_server_baton(server_baton_t **baton,
     }
   if (err)
     {
-      log_error(err, b);
-      io_err = svn_ra_svn__write_cmd_failure(conn, scratch_pool, err);
-      svn_error_clear(err);
-      SVN_ERR(io_err);
-      return svn_ra_svn__flush(conn, scratch_pool);
+      /* Report these errors to the client before closing the connection. */
+      err = svn_error_compose_create(err,
+              svn_ra_svn__write_cmd_failure(conn, scratch_pool, err));
+      err = svn_error_compose_create(err,
+              svn_ra_svn__flush(conn, scratch_pool));
+      return err;
     }
 
   SVN_ERR(svn_fs_get_uuid(b->repository->fs, &b->repository->uuid,