summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Behrens <Thorsten.Behrens@CIB.de>2019-12-20 07:03:47 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2019-12-20 22:09:32 +0100
commit56a7cf2a4c54f535b185d76497e591433bdb654e (patch)
tree5281da2e46462d4cf5ae3ad832c64daf9156dbdc
parentf0d8a212127f8aea21369f0ee01d5806baa0dcee (diff)
tdf#129519 Fix crash during WebDAV lock refresh
- NeonSession is shared amongst several files (if on the same server instance) - there's explicit code in DAVSessionFactory::createDAVSession() to share sessions for same host/target - so then after a while, locks get refreshed, and session timeout hits - first lock -> no prob, ne_auth.c:ah_post_send() has auth_challenge() failing, returning error, which puts that lock into m_aRemoveDeferred list - _but_ ah_post_send() then does a clean_session(), and the next lock refresh from the same session hits NULLPTR session host -> so let's delay any sspi_host cleanup until session object gets freed, instead of just cleaned Change-Id: Ie257310c47913aef9fcfec92c1722d64b28c4f89 Reviewed-on: https://gerrit.libreoffice.org/85614 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--external/neon/UnpackedTarball_neon.mk1
-rw-r--r--external/neon/neon_fix_sspi_session_timeout.patch22
2 files changed, 23 insertions, 0 deletions
diff --git a/external/neon/UnpackedTarball_neon.mk b/external/neon/UnpackedTarball_neon.mk
index dacf425fa80f..74ac2eb38c97 100644
--- a/external/neon/UnpackedTarball_neon.mk
+++ b/external/neon/UnpackedTarball_neon.mk
@@ -24,6 +24,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,neon,\
external/neon/ubsan.patch \
external/neon/neon_fix_lock_token_on_if.patch \
external/neon/neon_fix_lock_timeout_windows.patch \
+ external/neon/neon_fix_sspi_session_timeout.patch \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/neon/neon_fix_sspi_session_timeout.patch b/external/neon/neon_fix_sspi_session_timeout.patch
new file mode 100644
index 000000000000..5003fda35022
--- /dev/null
+++ b/external/neon/neon_fix_sspi_session_timeout.patch
@@ -0,0 +1,22 @@
+--- src/ne_auth.c~ 2019-12-05 15:38:50.246997951 +0100
++++ src/ne_auth.c 2019-12-20 06:54:31.555836285 +0100
+@@ -300,8 +300,6 @@
+ sess->sspi_token = NULL;
+ ne_sspi_destroy_context(sess->sspi_context);
+ sess->sspi_context = NULL;
+- if (sess->sspi_host) ne_free(sess->sspi_host);
+- sess->sspi_host = NULL;
+ #endif
+ #ifdef HAVE_NTLM
+ if (sess->ntlm_context) {
+@@ -1599,6 +1597,10 @@
+ }
+
+ clean_session(sess);
++#ifdef HAVE_SSPI
++ if (sess->sspi_host) ne_free(sess->sspi_host);
++ sess->sspi_host = NULL;
++#endif
+ ne_free(sess);
+ }
+