"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "shell/source/unix/exec/shellexec.cxx" between
libreoffice-6.2.3.1.tar.xz and libreoffice-6.2.3.2.tar.xz

About: LibreOffice source code (core). "Fresh" packages (pre-release version).

shellexec.cxx  (libreoffice-6.2.3.1.tar.xz):shellexec.cxx  (libreoffice-6.2.3.2.tar.xz)
skipping to change at line 46 skipping to change at line 46
#include <com/sun/star/uri/UriReferenceFactory.hpp> #include <com/sun/star/uri/UriReferenceFactory.hpp>
#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/supportsservice.hxx>
#include <comphelper/lok.hxx> #include <comphelper/lok.hxx>
#include <uno/current_context.hxx> #include <uno/current_context.hxx>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#if defined MACOSX
#include <sys/stat.h>
#endif
using com::sun::star::system::XSystemShellExecute; using com::sun::star::system::XSystemShellExecute;
using com::sun::star::system::SystemShellExecuteException; using com::sun::star::system::SystemShellExecuteException;
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang; using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::system::SystemShellExecuteFlags; using namespace ::com::sun::star::system::SystemShellExecuteFlags;
using namespace cppu; using namespace cppu;
namespace namespace
{ {
skipping to change at line 116 skipping to change at line 120
m_xContext)->translateToExternal(aCommand); m_xContext)->translateToExternal(aCommand);
if ( aURL.isEmpty() && !aCommand.isEmpty() ) if ( aURL.isEmpty() && !aCommand.isEmpty() )
{ {
throw RuntimeException( throw RuntimeException(
"Cannot translate URI reference to external format: " "Cannot translate URI reference to external format: "
+ aCommand, + aCommand,
static_cast< cppu::OWeakObject * >(this)); static_cast< cppu::OWeakObject * >(this));
} }
#ifdef MACOSX #ifdef MACOSX
if (uri->getScheme().equalsIgnoreAsciiCase("file")) {
OUString pathname;
auto const e1 = osl::FileBase::getSystemPathFromFileURL(aCommand, pa
thname);
if (e1 != osl::FileBase::E_None) {
throw css::lang::IllegalArgumentException(
("XSystemShellExecute.execute, getSystemPathFromFileURL <" +
aCommand
+ "> failed with " + OUString::number(e1)),
{}, 0);
}
OString pathname8;
if (!pathname.convertToString(
&pathname8, RTL_TEXTENCODING_UTF8,
(RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
| RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR)))
{
throw css::lang::IllegalArgumentException(
"XSystemShellExecute.execute, cannot convert \"" + pathname
+ "\" to UTF-8", {},
0);
}
struct stat st;
auto const e2 = stat(pathname8.getStr(), &st);
if (e2 != 0) {
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)
{
throw css::lang::IllegalArgumentException(
"XSystemShellExecute.execute, cannot process <" + aCommand +
">", {}, 0);
}
}
//TODO: Using open(1) with an argument that syntactically is an absolute //TODO: Using open(1) with an argument that syntactically is an absolute
// URI reference does not necessarily give expected results: // URI reference does not necessarily give expected results:
// 1 If the given URI reference matches a supported scheme (e.g., // 1 If the given URI reference matches a supported scheme (e.g.,
// "mailto:foo"): // "mailto:foo"):
// 1.1 If it matches an existing pathname (relative to CWD): Results // 1.1 If it matches an existing pathname (relative to CWD): Results
// in "mailto:foo?\n[0]\tcancel\n[1]\tOpen the file\tmailto:foo\n[2]\t // in "mailto:foo?\n[0]\tcancel\n[1]\tOpen the file\tmailto:foo\n[2]\t
// Open the URL\tmailto:foo\n\nWhich did you mean? Cancelled." on // Open the URL\tmailto:foo\n\nWhich did you mean? Cancelled." on
// stderr and SystemShellExecuteException. // stderr and SystemShellExecuteException.
// 1.2 If it does not match an exitsting pathname (relative to CWD): // 1.2 If it does not match an exitsting pathname (relative to CWD):
// Results in the corresponding application being opened with the given // Results in the corresponding application being opened with the given
 End of changes. 2 change blocks. 
0 lines changed or deleted 42 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)