ucb/source/ucp/webdav-curl/CurlSession.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 16b15b8d0ce7a94a5374706cba65a354e1f4dbe1
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue Jun 6 14:06:35 2023 +0200
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Fri Jun 23 22:52:11 2023 +0200

    ucb: webdav-curl: auth data is invalid when receiving 401
    
    Even if it used to be valid before; unfortunately newly entered
    credentials weren't actually used because the flag was never reset.
    
    Change-Id: Ib36689f40ff780596b9cfe6fe589a6f2e79cfcd2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152679
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 7efdacc1cd529e1801c9adf803a1a2db8334e67a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152658
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx 
b/ucb/source/ucp/webdav-curl/CurlSession.cxx
index 86eb265f55c6..5773fd2398f6 100644
--- a/ucb/source/ucp/webdav-curl/CurlSession.cxx
+++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx
@@ -1388,6 +1388,10 @@ auto CurlProcessor::ProcessRequest(
                     case SC_UNAUTHORIZED:
                     case SC_PROXY_AUTHENTICATION_REQUIRED:
                     {
+                        (statusCode != SC_PROXY_AUTHENTICATION_REQUIRED
+                             ? rSession.m_isAuthenticated
+                             : rSession.m_isAuthenticatedProxy)
+                            = false; // any auth data in m_pCurl is invalid
                         auto& rnAuthRequests(statusCode == SC_UNAUTHORIZED ? 
nAuthRequests
                                                                            : 
nAuthRequestsProxy);
                         if (rnAuthRequests == 10)

Reply via email to