summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-07-08 16:25:16 +1000
committerMike Kaganski <mike.kaganski@collabora.com>2019-07-08 14:01:26 +0200
commit351b730e012fd4562f341967f740f8146aa0538e (patch)
tree2bb7cabaa9816df22954096f71c35606588eaee9 /ucb
parent460461ae4244ef034c5579d6452dda6e8bda49e4 (diff)
tdf#126279: reinitialize session after NE_AUTH errors in (UN)LOCK
This just fixes the crash; but there's still a problem left/TODO, because the lock is kept registered with NeonLockStore; following attempts to lock and unlock fail. The NE_AUTH error is returned from this call stack: neon.dll!clean_session(auth_session * sess) Line 275 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(275) neon.dll!ah_post_send(ne_request_s * req, void * cookie, const ne_status * status) Line 1554 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(1554) neon.dll!ne_end_request(ne_request_s * req) Line 1399 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_request.c(1399) neon.dll!ne_xml_dispatch_request(ne_request_s * req, ne_xml_parser_s * parser) Line 105 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_xmlreq.c(105) neon.dll!ne_lock_refresh(ne_session_s * sess, ne_lock * lock) Line 849 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_locks.c(849) ucpdav1.dll!webdav_ucp::NeonSession::LOCK(ne_lock * pLock, long & rlastChanceToSendRefreshRequest) Line 1663 at C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\NeonSession.cxx(1663) ucpdav1.dll!webdav_ucp::NeonLockStore::refreshLocks() Line 216 at C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\NeonLockStore.cxx(216) ucpdav1.dll!webdav_ucp::TickerThread::execute() Line 78 at C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\NeonLockStore.cxx(78) salhelper3MSC.dll!salhelper::Thread::run() Line 40 at C:\cygwin\home\user\lode\dev\core\salhelper\source\thread.cxx(40) salhelper3MSC.dll!threadFunc(void * param) Line 186 at C:\cygwin\home\user\lode\dev\core\include\osl\thread.hxx(186) sal3.dll!oslWorkerWrapperFunction(void * pData) Line 58 at C:\cygwin\home\user\lode\dev\core\sal\osl\w32\thread.cxx(58) ucrtbased.dll!thread_start<unsigned int (__cdecl*)(void *),1>(void * const parameter) Line 97 at minkernel\crts\ucrt\src\appcrt\startup\thread.cpp(97) kernel32.dll!BaseThreadInitThunk() ntdll.dll!RtlUserThreadStart() If not reinitialized, then on next access, it SEGFAULTs (hostname is nullptr): neon.dll!ne_addr_resolve(const char * hostname, int flags) Line 926 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_socket.c(926) neon.dll!canonical_hostname(const char * serverName) Line 382 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_sspi.c(382) neon.dll!ne_sspi_create_context(void * * context, char * serverName, int ntlm) Line 423 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_sspi.c(423) neon.dll!continue_sspi(auth_session * sess, int ntlm, const char * hdr, int attempt, auth_challenge * parms, ne_buffer * * errmsg) Line 639 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(639) neon.dll!sspi_challenge(auth_session * sess, int attempt, auth_challenge * parms, ne_buffer * * errmsg) Line 675 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(675) neon.dll!auth_challenge(auth_session * sess, int attempt, const char * value) Line 1419 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(1419) neon.dll!ah_post_send(ne_request_s * req, void * cookie, const ne_status * status) Line 1550 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_auth.c(1550) neon.dll!ne_end_request(ne_request_s * req) Line 1399 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_request.c(1399) neon.dll!ne_request_dispatch(ne_request_s * req) Line 1458 at C:\cygwin\home\user\lode\dev\core\workdir\UnpackedTarball\neon\src\ne_request.c(1458) ucpdav1.dll!webdav_ucp::NeonSession::OPTIONS(const rtl::OUString & inPath, webdav_ucp::DAVOptions & rOptions, const webdav_ucp::DAVRequestEnvironment & rEnv) Line 913 at C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\NeonSession.cxx(913) ucpdav1.dll!webdav_ucp::DAVResourceAccess::OPTIONS(webdav_ucp::DAVOptions & rOptions, const com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> & xEnv) Line 187 at C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\DAVResourceAccess.cxx(187) ucpdav1.dll!webdav_ucp::Content::getResourceOptions(const com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> & xEnv, webdav_ucp::DAVOptions & rDAVOptions, const std::unique_ptr<webdav_ucp::DAVResourceAccess,std::default_delete<webdav_ucp::DAVResourceAccess> > & rResAccess, bool * networkAccessAllowed) Line 3940 at C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\webdavcontent.cxx(3940) ucpdav1.dll!webdav_ucp::Content::getProperties(const com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> & xEnv) Line 323 at C:\cygwin\home\user\lode\dev\core\ucb\source\ucp\webdav-neon\webdavcontentcaps.cxx(323) ucbhelper.dll!ucbhelper::PropertySetInfo::getProperties() Line 106 at C:\cygwin\home\user\lode\dev\core\ucbhelper\source\provider\contentinfo.cxx(106) ucbhelper.dll!ucbhelper::PropertySetInfo::queryProperty(const rtl::OUString & rName, com::sun::star::beans::Property & rProp) Line 187 at C:\cygwin\home\user\lode\dev\core\ucbhelper\source\provider\contentinfo.cxx(187) ucbhelper.dll!ucbhelper::PropertySetInfo::hasPropertyByName(const rtl::OUString & Name) Line 168 at C:\cygwin\home\user\lode\dev\core\ucbhelper\source\provider\contentinfo.cxx(168) sfxlo.dll!SfxBaseModel::getBoolPropertyValue(const rtl::OUString & rName) Line 2582 at C:\cygwin\home\user\lode\dev\core\sfx2\source\doc\sfxbasemodel.cxx(2582) sfxlo.dll!SfxBaseModel::isVersionable() Line 2599 at C:\cygwin\home\user\lode\dev\core\sfx2\source\doc\sfxbasemodel.cxx(2599) sfxlo.dll!SfxObjectShell::GetState_Impl(SfxItemSet & rSet) Line 1133 at C:\cygwin\home\user\lode\dev\core\sfx2\source\doc\objserv.cxx(1133) sfxlo.dll!SfxStubSfxObjectShellGetState_Impl(SfxShell * pShell, SfxItemSet & rSet) Line 220 at C:\cygwin\home\user\lode\dev\core\workdir\SdiTarget\sfx2\sdi\sfxslots.hxx(220) sfxlo.dll!SfxShell::CallState(void(*)(SfxShell *, SfxItemSet &) pFunc, SfxItemSet & rSet) Line 199 at C:\cygwin\home\user\lode\dev\core\include\sfx2\shell.hxx(199) sfxlo.dll!SfxShell::GetSlotState(unsigned short nSlotId, const SfxInterface * pIF, SfxItemSet * pStateSet) Line 480 at C:\cygwin\home\user\lode\dev\core\sfx2\source\control\shell.cxx(480) sfxlo.dll!SfxDispatcher::QueryState(unsigned short nSID, com::sun::star::uno::Any & rAny) Line 1967 at C:\cygwin\home\user\lode\dev\core\sfx2\source\control\dispatch.cxx(1967) sfxlo.dll!SfxDispatchController_Impl::addStatusListener(const com::sun::star::uno::Reference<com::sun::star::frame::XStatusListener> & aListener, const com::sun::star::util::URL & aURL) Line 832 at C:\cygwin\home\user\lode\dev\core\sfx2\source\control\unoctitm.cxx(832) sfxlo.dll!SfxOfficeDispatch::addStatusListener(const com::sun::star::uno::Reference<com::sun::star::frame::XStatusListener> & aListener, const com::sun::star::util::URL & aURL) Line 252 at C:\cygwin\home\user\lode\dev\core\sfx2\source\control\unoctitm.cxx(252) fwklo.dll!framework::MenuBarManager::Activate(Menu * pMenu) Line 756 at C:\cygwin\home\user\lode\dev\core\framework\source\uielement\menubarmanager.cxx(756) fwklo.dll!framework::MenuBarManager::LinkStubActivate(void * instance, Menu * data) Line 605 at C:\cygwin\home\user\lode\dev\core\framework\source\uielement\menubarmanager.cxx(605) vcllo.dll!Link<Menu *,bool>::Call(Menu * data) Line 112 at C:\cygwin\home\user\lode\dev\core\include\tools\link.hxx(112) vcllo.dll!Menu::Activate() Line 270 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\menu.cxx(270) vcllo.dll!PopupMenu::ImplExecute(const VclPtr<vcl::Window> & pW, const tools::Rectangle & rRect, FloatWinPopupFlags nPopupModeFlags, Menu * pSFrom, bool bPreSelectFirst) Line 2876 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\menu.cxx(2876) vcllo.dll!MenuBarWindow::ImplCreatePopup(bool bPreSelectFirst) Line 339 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\menubarwindow.cxx(339) vcllo.dll!MenuBarWindow::ChangeHighlightItem(unsigned short n, bool bSelectEntry, bool bAllowRestoreFocus, bool bDefaultToDocument) Line 558 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\menubarwindow.cxx(558) vcllo.dll!MenuBarWindow::MouseButtonDown(const MouseEvent & rMEvt) Line 403 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\menubarwindow.cxx(403) vcllo.dll!ImplHandleMouseEvent(const VclPtr<vcl::Window> & xWindow, MouseNotifyEvent nSVEvent, bool bMouseLeave, long nX, long nY, unsigned __int64 nMsgTime, unsigned short nCode, MouseEventModifiers nMode) Line 700 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\winproc.cxx(700) vcllo.dll!ImplHandleSalMouseButtonDown(vcl::Window * pWindow, const SalMouseEvent * pEvent) Line 2017 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\winproc.cxx(2017) vcllo.dll!ImplWindowFrameProc(vcl::Window * _pWindow, SalEvent nEvent, const void * pEvent) Line 2351 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\winproc.cxx(2351) vcllo.dll!SalFrame::CallCallback(SalEvent nEvent, const void * pEvent) Line 299 at C:\cygwin\home\user\lode\dev\core\vcl\inc\salframe.hxx(299) vclplug_winlo.dll!ImplHandleMouseMsg(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 3132 at C:\cygwin\home\user\lode\dev\core\vcl\win\window\salframe.cxx(3132) vclplug_winlo.dll!SalFrameWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam, bool & rDef) Line 5487 at C:\cygwin\home\user\lode\dev\core\vcl\win\window\salframe.cxx(5487) vclplug_winlo.dll!SalFrameWndProcW(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 5840 at C:\cygwin\home\user\lode\dev\core\vcl\win\window\salframe.cxx(5840) user32.dll!UserCallWinProcCheckWow() user32.dll!CallWindowProcW() opengl32.dll!wglWndProc() user32.dll!UserCallWinProcCheckWow() user32.dll!DispatchMessageWorker() vclplug_winlo.dll!ImplSalDispatchMessage(const tagMSG * pMsg) Line 411 at C:\cygwin\home\user\lode\dev\core\vcl\win\app\salinst.cxx(411) vclplug_winlo.dll!ImplSalYield(bool bWait, bool bHandleAllCurrentEvents) Line 484 at C:\cygwin\home\user\lode\dev\core\vcl\win\app\salinst.cxx(484) vclplug_winlo.dll!WinSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents) Line 513 at C:\cygwin\home\user\lode\dev\core\vcl\win\app\salinst.cxx(513) vcllo.dll!ImplYield(bool i_bWait, bool i_bAllEvents) Line 447 at C:\cygwin\home\user\lode\dev\core\vcl\source\app\svapp.cxx(447) vcllo.dll!Application::Yield() Line 512 at C:\cygwin\home\user\lode\dev\core\vcl\source\app\svapp.cxx(512) vcllo.dll!Application::Execute() Line 428 at C:\cygwin\home\user\lode\dev\core\vcl\source\app\svapp.cxx(428) sofficeapp.dll!desktop::Desktop::Main() Line 1620 at C:\cygwin\home\user\lode\dev\core\desktop\source\app\app.cxx(1620) vcllo.dll!ImplSVMain() Line 191 at C:\cygwin\home\user\lode\dev\core\vcl\source\app\svmain.cxx(191) vcllo.dll!SVMain() Line 226 at C:\cygwin\home\user\lode\dev\core\vcl\source\app\svmain.cxx(226) sofficeapp.dll!soffice_main() Line 170 at C:\cygwin\home\user\lode\dev\core\desktop\source\app\sofficemain.cxx(170) soffice.bin!sal_main() Line 48 at C:\cygwin\home\user\lode\dev\core\desktop\source\app\main.c(48) soffice.bin!main(int argc, char * * argv) Line 47 at C:\cygwin\home\user\lode\dev\core\desktop\source\app\main.c(47) soffice.bin!invoke_main() Line 79 at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(79) soffice.bin!__scrt_common_main_seh() Line 288 at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(288) soffice.bin!__scrt_common_main() Line 331 at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(331) soffice.bin!mainCRTStartup() Line 17 at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp(17) kernel32.dll!BaseThreadInitThunk() ntdll.dll!RtlUserThreadStart() Change-Id: I632d85b65406e29ad0e3d56d8481c651c64b2ec8 Reviewed-on: https://gerrit.libreoffice.org/75194 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/webdav-neon/NeonSession.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx b/ucb/source/ucp/webdav-neon/NeonSession.cxx
index 7ee9c56d4807..cd8b31f9d359 100644
--- a/ucb/source/ucp/webdav-neon/NeonSession.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx
@@ -1659,7 +1659,8 @@ bool NeonSession::LOCK( NeonLock * pLock,
TimeValue startCall;
osl_getSystemTime( &startCall );
- if ( ne_lock_refresh( m_pHttpSession, pLock ) == NE_OK )
+ const int theRetVal = ne_lock_refresh(m_pHttpSession, pLock);
+ if (theRetVal == NE_OK)
{
rlastChanceToSendRefreshRequest
= lastChanceToSendRefreshRequest( startCall, pLock->timeout );
@@ -1674,6 +1675,11 @@ bool NeonSession::LOCK( NeonLock * pLock,
SAL_WARN( "ucb.ucp.webdav", "LOCK (refresh) - not refreshed! Relative URL: <" << p << "> token: <" << pLock->token << ">" );
ne_free( p );
#endif
+ if (theRetVal == NE_AUTH)
+ {
+ // tdf#126279: see handling of NE_AUTH in HandleError
+ m_bNeedNewSession = true;
+ }
return false;
}
}
@@ -1720,7 +1726,8 @@ bool NeonSession::UNLOCK( NeonLock * pLock )
}
#endif
- if ( ne_unlock( m_pHttpSession, pLock ) == NE_OK )
+ const int theRetVal = ne_unlock(m_pHttpSession, pLock);
+ if (theRetVal == NE_OK)
{
#if defined SAL_LOG_INFO
{
@@ -1740,6 +1747,11 @@ bool NeonSession::UNLOCK( NeonLock * pLock )
ne_free( p );
}
#endif
+ if (theRetVal == NE_AUTH)
+ {
+ // tdf#126279: see handling of NE_AUTH in HandleError
+ m_bNeedNewSession = true;
+ }
return false;
}
}