[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - shell/source
shell/source/unix/exec/shellexec.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit f577d5df3f694ca0710caf35ac09e59f9041a2cc Author: Stephan Bergmann AuthorDate: Tue Apr 20 15:44:18 2021 +0200 Commit: Andras Timar CommitDate: Tue Apr 27 21:52:16 2021 +0200 Better handling of filelocs Change-Id: Ic9c06cb476942ceb7d0166f22103e2e88cc9c21f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114339 Tested-by: Jenkins Reviewed-by: Stephan Bergmann (cherry picked from commit 177dcfec4e833f83f1f11c7bdbfc6f1977ebcee7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114355 Reviewed-by: Caolán McNamara diff --git a/shell/source/unix/exec/shellexec.cxx b/shell/source/unix/exec/shellexec.cxx index 0810b0534112..093a8a2ba57f 100644 --- a/shell/source/unix/exec/shellexec.cxx +++ b/shell/source/unix/exec/shellexec.cxx @@ -151,6 +151,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar throw css::lang::IllegalArgumentException( "XSystemShellExecute.execute, cannot process <" + aCommand + ">", {}, 0); } else if (pathname.endsWithIgnoreAsciiCase(".class") + || pathname.endsWithIgnoreAsciiCase(".fileloc") || pathname.endsWithIgnoreAsciiCase(".jar")) { dir = true; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - shell/source
shell/source/unix/exec/shellexec.cxx | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) New commits: commit 9a3566d743a1ab3e547145f28927a2c695d256b5 Author: Stephan Bergmann AuthorDate: Fri Nov 15 08:45:20 2019 +0100 Commit: Tor Lillqvist CommitDate: Fri Apr 16 17:49:56 2021 +0200 tdf#128538: Open filesystem directories in Finder after all Where option "-R" means, according to the open(1) man page: "Reveals the file(s) in the Finder instead of opening them." This appears to always reveal in Finder, even for *.app "application directories", so should not affect CVE-2019-9847.) Change-Id: I775db7bf71c09adc6570931a977b82dfee8dc95a Reviewed-on: https://gerrit.libreoffice.org/82749 Tested-by: Jenkins Reviewed-by: Stephan Bergmann (cherry picked from commit 1ff1466b055890b2ca0ff3a47262bc048ad78542) Reviewed-on: https://gerrit.libreoffice.org/82756 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114213 Reviewed-by: Tor Lillqvist Tested-by: Tor Lillqvist diff --git a/shell/source/unix/exec/shellexec.cxx b/shell/source/unix/exec/shellexec.cxx index 86c3672162c0..0810b0534112 100644 --- a/shell/source/unix/exec/shellexec.cxx +++ b/shell/source/unix/exec/shellexec.cxx @@ -117,6 +117,7 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar } #ifdef MACOSX +bool dir = false; if (uri->getScheme().equalsIgnoreAsciiCase("file")) { OUString pathname; auto const e1 = osl::FileBase::getSystemPathFromFileURL(aCommand, pathname); @@ -142,8 +143,10 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar auto const e3 = errno; SAL_INFO("shell", "stat(" << pathname8 << ") failed with errno " << e3); } -if (e2 != 0 || !S_ISREG(st.st_mode) -|| (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) != 0) +if (e2 == 0 && S_ISDIR(st.st_mode)) { +dir = true; +} else if (e2 != 0 || !S_ISREG(st.st_mode) + || (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) != 0) { throw css::lang::IllegalArgumentException( "XSystemShellExecute.execute, cannot process <" + aCommand + ">", {}, 0); @@ -176,7 +179,11 @@ void SAL_CALL ShellExec::execute( const OUString& aCommand, const OUString& aPar // 2.4 If it does not match an exitsting pathname (relative to CWD): // Results in "The file /.../foo:bar does not exits." (where "/..." is // the CWD) on stderr and SystemShellExecuteException. -aBuffer.append("open --"); +aBuffer.append("open"); +if (dir) { +aBuffer.append(" -R"); +} +aBuffer.append(" --"); #else // Just use xdg-open on non-Mac aBuffer.append("/usr/bin/xdg-open"); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - shell/source
shell/source/win32/SysShExec.cxx |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) New commits: commit 70bfb667663f962d11061fafc9eeb54483df8b15 Author: Stephan Bergmann AuthorDate: Wed Jan 15 17:16:02 2020 +0100 Commit: Mike Kaganski CommitDate: Fri Jun 5 13:33:01 2020 +0200 Remove a fragment from a file URL early on ...as ShellExecuteExW would ignore it anyway Change-Id: I969db094bb7d2ea230ac8c36eb23d71a90fbe466 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86868 Tested-by: Jenkins Reviewed-by: Stephan Bergmann (cherry picked from commit 14b36a16b225bf7c988f118d499a7287c47cd83e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86877 Reviewed-by: Mike Kaganski (cherry picked from commit 51da0d22ff42b20ab38130b7874651ef136ecceb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95429 Tested-by: Jenkins CollaboraOffice diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx index 910aae1c095f..c4091616f7d8 100644 --- a/shell/source/win32/SysShExec.cxx +++ b/shell/source/win32/SysShExec.cxx @@ -301,6 +301,7 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa static_cast< XSystemShellExecute* >( this ), 3 ); +OUString preprocessed_command(aCommand); if ((nFlags & URIS_ONLY) != 0) { css::uno::Reference< css::uri::XUriReference > uri( @@ -314,8 +315,10 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa static_cast< cppu::OWeakObject * >(this), 0); } if (uri->getScheme().equalsIgnoreAsciiCase("file")) { +// ShellExecuteExW appears to ignore the fragment of a file URL anyway, so remove it: +uri->clearFragment(); +preprocessed_command = uri->getUriReference(); OUString pathname; -uri->clearFragment(); // getSystemPathFromFileURL fails for URLs with fragment auto const e1 = osl::FileBase::getSystemPathFromFileURL(uri->getUriReference(), pathname); if (e1 != osl::FileBase::E_None) { @@ -419,7 +422,6 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa and names no existing file (remember the jump mark sign '#' is a valid file name character we remove the jump mark, else ShellExecuteEx fails */ -OUString preprocessed_command(aCommand); if (is_system_path(preprocessed_command)) { if (has_jump_mark(preprocessed_command) && !is_existing_file(preprocessed_command)) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - shell/source
shell/source/win32/simplemail/senddoc.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 78beb3c194f0f9828b3b2637c818807eb13ca573 Author: Jan-Marek Glogowski AuthorDate: Tue Jul 23 13:48:47 2019 +0200 Commit: Andras Timar CommitDate: Mon Aug 5 12:09:56 2019 +0200 tdf#126597 don't use modeless dialog for senddoc.exe There is already a large comment in initAttachmentList about problems with MAPI_DIALOG_MODELESS. Using MAPI_DIALOG_MODELESS with Outlook 2016 and multiple attachments sometimes produces a MAPI_E_FAILURE, but most times it crashes for me. And it's not a problem with the removed temporary files, as uncommenting that shows the same problem. And there seems to be many more problems: https://social.msdn.microsoft.com/Forums/en-US/5d8fece6-9d93-490c-9331-625c17e3291d/mapisendmailhelper-and-mapidialogmodeless But actually I don't see any blocking of LO, if I switch to using MAPI_DIALOG, as senddoc.exe already runs in the background. So this switches MAPI_DIALOG_MODELESS to MAPI_DIALOG. This reverts commit 5874c76371562c3e2d8564b1fb04df1997091d27 ("tdf#116074: Use modeless dialogs with supporting mailers"). Change-Id: Ie0f8f22196d1a174dfeada2bc4aabb1717ee16a7 Reviewed-on: https://gerrit.libreoffice.org/76155 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski (cherry picked from commit e79f61340405dcc75f3fe41f727dea4ba4202c2e) Reviewed-on: https://gerrit.libreoffice.org/76611 Reviewed-by: Samuel Mehrbrodt Tested-by: Samuel Mehrbrodt (cherry picked from commit 222e3782dfa885370c5adbaf87aeed4fcbb5f107) Reviewed-on: https://gerrit.libreoffice.org/76950 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/shell/source/win32/simplemail/senddoc.cxx b/shell/source/win32/simplemail/senddoc.cxx index 04cb153a2b4f..872fcce62c3e 100644 --- a/shell/source/win32/simplemail/senddoc.cxx +++ b/shell/source/win32/simplemail/senddoc.cxx @@ -207,8 +207,9 @@ static void initParameter(int argc, wchar_t* argv[]) if (_wcsicmp(argv[i], L"--mapi-dialog") == 0) { -// Outlook 2013+; for earlier versions this equals to MAPI_DIALOG -gMapiFlags |= MAPI_DIALOG_MODELESS; +// MAPI_DIALOG_MODELESS has many problems and crashes Outlook 2016. +// see the commit message for a lengthy description. +gMapiFlags |= MAPI_DIALOG; } else if (_wcsicmp(argv[i], L"--mapi-logon-ui") == 0) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - shell/source
shell/source/win32/spsupp/res/spsuppDlg.rc |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 2edb7b1ddaa77229ce3655b91929eba3d95f90a7 Author: Mike Kaganski AuthorDate: Thu Jul 4 19:46:35 2019 +1000 Commit: Mike Kaganski CommitDate: Thu Jul 4 15:34:58 2019 +0200 Center spsupp_helper dialog on screen; make it topmost Change-Id: I99cf333a24ddf99407b406e42930d58dc7b5fb96 Reviewed-on: https://gerrit.libreoffice.org/75076 Tested-by: Jenkins Reviewed-by: Mike Kaganski (cherry picked from commit 64376d29b4f02440544a1dc71118c2cf19b8df94) Reviewed-on: https://gerrit.libreoffice.org/75088 Tested-by: Mike Kaganski diff --git a/shell/source/win32/spsupp/res/spsuppDlg.rc b/shell/source/win32/spsupp/res/spsuppDlg.rc index a27974661f30..f4ce83a157fc 100644 --- a/shell/source/win32/spsupp/res/spsuppDlg.rc +++ b/shell/source/win32/spsupp/res/spsuppDlg.rc @@ -17,9 +17,9 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_DEFAULT // Dialog IDD_EDIT_OR_RO DIALOGEX 0, 0, 309, 87 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_TOPMOST CAPTION "Open Document" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN ICONIDI_QUESTION,IDC_STATIC,7,7,21,20 LTEXT "Do you want to open the document to view or to edit?",IDC_EDIT_OR_RO,36,7,266,44 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - shell/source
shell/source/win32/spsupp/res/spsupp.rc | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) New commits: commit 1e5933f0e60ca44e908a4aab81fd8802f234b081 Author: Mike Kaganski AuthorDate: Fri May 17 14:39:04 2019 +0200 Commit: Mike Kaganski CommitDate: Thu Jun 20 06:33:23 2019 +0200 Add license statement Change-Id: Ib7ed7b3d94c04c09debe910a76cd720802f1a6f6 Reviewed-on: https://gerrit.libreoffice.org/72475 Reviewed-by: Mike Kaganski Tested-by: Mike Kaganski (cherry picked from commit fa7412039f7d89a9b15aeabb99b0f5380b690cfa) Reviewed-on: https://gerrit.libreoffice.org/74405 diff --git a/shell/source/win32/spsupp/res/spsupp.rc b/shell/source/win32/spsupp/res/spsupp.rc index c7f62aeb24e3..20e323e16a7b 100644 --- a/shell/source/win32/spsupp/res/spsupp.rc +++ b/shell/source/win32/spsupp/res/spsupp.rc @@ -1 +1,12 @@ -1 TYPELIB TLB_FILE \ No newline at end of file +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* +* This file is part of the LibreOffice project. +* +* This Source Code Form is subject to the terms of the Mozilla Public +* License, v. 2.0. If a copy of the MPL was not distributed with this +* file, You can obtain one at http://mozilla.org/MPL/2.0/. +*/ + +// Type library + +1 TYPELIB TLB_FILE ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - shell/source
shell/source/win32/spsupp/COMOpenDocuments.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit 46b1e36e369ecea4946ad6a3cc0223d3be30cc85 Author: Mike Kaganski AuthorDate: Thu May 16 07:49:46 2019 +0200 Commit: Mike Kaganski CommitDate: Thu Jun 20 06:30:35 2019 +0200 Drop obsolete commented out debug output Change-Id: I60f7bbb2921b242396b4620077ca30e12a0d3b4b Reviewed-on: https://gerrit.libreoffice.org/72393 Tested-by: Jenkins Reviewed-by: Mike Kaganski (cherry picked from commit 04b055f111be7044bdd97865a8f0b11215b25191) Reviewed-on: https://gerrit.libreoffice.org/74404 Tested-by: Mike Kaganski diff --git a/shell/source/win32/spsupp/COMOpenDocuments.cxx b/shell/source/win32/spsupp/COMOpenDocuments.cxx index 14406cba1d2d..2e6b8cfad8ec 100644 --- a/shell/source/win32/spsupp/COMOpenDocuments.cxx +++ b/shell/source/win32/spsupp/COMOpenDocuments.cxx @@ -159,7 +159,6 @@ STDMETHODIMP COMOpenDocuments::Invoke( EXCEPINFO *pExcepInfo, UINT *puArgErr) { -//ReportInvoke(m_pTypeInfo, dispIdMember, pDispParams); return DispInvoke(this, m_pTypeInfo, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - shell/source
shell/source/win32/spsupp/spsuppServ.cxx | 30 ++ 1 file changed, 14 insertions(+), 16 deletions(-) New commits: commit 00c65b6e2129cfccb1ff909ea88fe64e6c5f6f5b Author: Mike Kaganski AuthorDate: Wed May 15 08:31:44 2019 +0200 Commit: Mike Kaganski CommitDate: Thu Jun 20 06:22:21 2019 +0200 Use lambdas to initialize statics Change-Id: Ib03bfd795967ba70333d71d9e5eeec97be90be79 Reviewed-on: https://gerrit.libreoffice.org/72334 Tested-by: Jenkins Reviewed-by: Mike Kaganski (cherry picked from commit a11536d5ea695826844581c8c8f883970e0c8294) Reviewed-on: https://gerrit.libreoffice.org/74402 Tested-by: Mike Kaganski diff --git a/shell/source/win32/spsupp/spsuppServ.cxx b/shell/source/win32/spsupp/spsuppServ.cxx index 78af725bec60..f15f505fd730 100644 --- a/shell/source/win32/spsupp/spsuppServ.cxx +++ b/shell/source/win32/spsupp/spsuppServ.cxx @@ -37,35 +37,33 @@ HANDLE g_hModule; ITypeLib* GetTypeLib() { typedef std::unique_ptr ITypeLibGuard; -static ITypeLibGuard aITypeLibGuard(nullptr, [](IUnknown* p) { if (p) p->Release(); }); -if (!aITypeLibGuard.get()) -{ +static ITypeLibGuard s_aITypeLibGuard = [] { +ITypeLibGuard aITypeLibGuard(nullptr, [](IUnknown* p) { if (p) p->Release(); }); wchar_t szFile[MAX_PATH]; if (GetModuleFileNameW(static_cast(g_hModule), szFile, MAX_PATH) == 0) -return nullptr; +return aITypeLibGuard; ITypeLib* pTypeLib; -HRESULT hr = LoadTypeLib(szFile, ); -if (FAILED(hr)) -return nullptr; +if (FAILED(LoadTypeLib(szFile, ))) +return aITypeLibGuard; aITypeLibGuard.reset(pTypeLib); -} -return aITypeLibGuard.get(); +return aITypeLibGuard; +}(); +return s_aITypeLibGuard.get(); } const wchar_t* GetLOPath() { -static wchar_t sPath[MAX_PATH] = { 0 }; -if (*sPath == 0) -{ -// Initialization +static wchar_t* s_sPath = []() -> wchar_t* { +static wchar_t sPath[MAX_PATH]; if (GetModuleFileNameW(static_cast(g_hModule), sPath, MAX_PATH) == 0) return nullptr; wchar_t* pSlashPos = wcsrchr(sPath, L'\\'); if (pSlashPos == nullptr) return nullptr; -wcscpy(pSlashPos+1, L"soffice.exe"); -} -return sPath; +wcscpy(pSlashPos + 1, L"soffice.exe"); +return sPath; +}(); +return s_sPath; } BOOL APIENTRY DllMain( HANDLE hinstDLL, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - shell/source
shell/source/win32/spsupp/COMOpenDocuments.cxx |6 ++ 1 file changed, 6 insertions(+) New commits: commit b3074ab189922d54f19e29c9868d27211beca8b3 Author: Mike Kaganski AuthorDate: Wed May 15 08:59:01 2019 +0200 Commit: Mike Kaganski CommitDate: Thu Jun 20 04:53:54 2019 +0200 Check passed pointers Change-Id: Idf5e77e4122ad4b5b91f25c50fdaaf25e34a76ae Reviewed-on: https://gerrit.libreoffice.org/72336 Tested-by: Jenkins Reviewed-by: Mike Kaganski (cherry picked from commit bb62eff4b4202ac85f3366d21fb1cbef52958b6d) Reviewed-on: https://gerrit.libreoffice.org/74401 Tested-by: Mike Kaganski diff --git a/shell/source/win32/spsupp/COMOpenDocuments.cxx b/shell/source/win32/spsupp/COMOpenDocuments.cxx index 4d00b8de6c46..13fdc6f8e5f3 100644 --- a/shell/source/win32/spsupp/COMOpenDocuments.cxx +++ b/shell/source/win32/spsupp/COMOpenDocuments.cxx @@ -314,6 +314,8 @@ STDMETHODIMP COMOpenDocuments::CreateNewDocument2( BSTR /*bstrDefaultSaveLocation*/, // A string that contains the path that specifies a suggested default location for saving the new document VARIANT_BOOL* pbResult) // true if the document creation succeeds; otherwise false { +if (!pbResult) +return E_POINTER; // TODO: resolve the program from varProgID (nullptr -> default?) HRESULT hr = LOStart(L"-n", bstrTemplateLocation, m_aObjectSafety.GetSafe_forUntrustedCaller() || m_aObjectSafety.GetSafe_forUntrustedData()); *pbResult = toVBool(SUCCEEDED(hr)); @@ -365,6 +367,8 @@ STDMETHODIMP COMOpenDocuments::ViewDocument3( VARIANT /*varProgID*/, // An optional string that contains the ProgID of the application with which to open the document. If this argument is omitted, the default viewer for the document is used VARIANT_BOOL *pbResult)// true if the document was successfully opened; otherwise false { +if (!pbResult) +return E_POINTER; // TODO: resolve the program from varProgID (nullptr -> default?) HRESULT hr = LOStart(L"--view", bstrDocumentLocation, m_aObjectSafety.GetSafe_forUntrustedCaller() || m_aObjectSafety.GetSafe_forUntrustedData()); *pbResult = toVBool(SUCCEEDED(hr)); @@ -427,6 +431,8 @@ STDMETHODIMP COMOpenDocuments::EditDocument3( VARIANT /*varProgID*/, // An optional string that contains the ProgID of the application with which to edit the document. If this argument is omitted, the default editor for the document is used VARIANT_BOOL *pbResult) // true if the document was successfully opened; otherwise false { +if (!pbResult) +return E_POINTER; // TODO: resolve the program from varProgID (nullptr -> default?) HRESULT hr = LOStart(L"-o", bstrDocumentLocation, m_aObjectSafety.GetSafe_forUntrustedCaller() || m_aObjectSafety.GetSafe_forUntrustedData()); *pbResult = toVBool(SUCCEEDED(hr)); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits