[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.0' - 2 commits - configure.ac scripting/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Oct 22 07:00:47 UTC 2018
configure.ac | 2 +-
scripting/source/pyprov/pythonscript.py | 30 ++++++++++++++++++++++++++++--
2 files changed, 29 insertions(+), 3 deletions(-)
New commits:
commit 312ef29bbecdab4d29709aebc24e6428e6c2b059
Author: Andras Timar <andras.timar at collabora.com>
AuthorDate: Mon Oct 22 00:00:24 2018 -0700
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Oct 22 00:00:24 2018 -0700
Bump version to 5.0-46
Change-Id: Idc22b8308e71a0a5eb37d009f343f8abae320994
diff --git a/configure.ac b/configure.ac
index 121fe43e17f6..b3ca7b6863c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
# several non-alphanumeric characters, those are split off and used only for the
# ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea.
-AC_INIT([Collabora Office],[5.0.10.45],[],[],[https://CollaboraOffice.com/])
+AC_INIT([Collabora Office],[5.0.10.46],[],[],[https://CollaboraOffice.com/])
AC_PREREQ([2.59])
commit 90977dafd1c818af5737d9d1150de96df76f2ca1
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Oct 18 20:39:23 2018 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Sun Oct 21 23:59:13 2018 -0700
keep pyuno script processing below base uri
Reviewed-on: https://gerrit.libreoffice.org/61969
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
(cherry picked from commit b1c85cdb37a47998f8ab135fbc96f186334b171c)
(cherry picked from commit a9d81dd30d809b9c5ce2d3e4752039f19be70494)
Change-Id: Icc13fb7193fb1e7c50e0df286161a10b4ed636c7
diff --git a/scripting/source/pyprov/pythonscript.py b/scripting/source/pyprov/pythonscript.py
index 03f0cdeae7c8..24e28ec19535 100644
--- a/scripting/source/pyprov/pythonscript.py
+++ b/scripting/source/pyprov/pythonscript.py
@@ -23,6 +23,7 @@ import os
import imp
import time
import ast
+from com.sun.star.uri.RelativeUriExcessParentSegments import RETAIN
try:
unicode
@@ -210,8 +211,33 @@ class MyUriHelper:
def scriptURI2StorageUri( self, scriptURI ):
try:
- myUri = self.m_uriRefFac.parse(scriptURI)
- ret = self.m_baseUri + "/" + myUri.getName().replace( "|", "/" )
+ # base path to the python script location
+ sBaseUri = self.m_baseUri + "/"
+ xBaseUri = self.m_uriRefFac.parse(sBaseUri)
+
+ # path to the .py file + "$functionname, arguments, etc
+ xStorageUri = self.m_uriRefFac.parse(scriptURI)
+ sStorageUri = xStorageUri.getName().replace( "|", "/" );
+
+ # path to the .py file, relative to the base
+ sFileUri = sStorageUri[0:sStorageUri.find("$")]
+ xFileUri = self.m_uriRefFac.parse(sFileUri)
+ if not xFileUri:
+ message = "pythonscript: invalid relative uri '" + sFileUri+ "'"
+ log.debug( message )
+ raise RuntimeException( message )
+
+ # absolute path to the .py file
+ xAbsScriptUri = self.m_uriRefFac.makeAbsolute(xBaseUri, xFileUri, True, RETAIN)
+ sAbsScriptUri = xAbsScriptUri.getUriReference()
+
+ # ensure py file is under the base path
+ if not sAbsScriptUri.startswith(sBaseUri):
+ message = "pythonscript: storage uri '" + sAbsScriptUri + "' not in base uri '" + self.m_baseUri + "'"
+ log.debug( message )
+ raise RuntimeException( message )
+
+ ret = sBaseUri + sStorageUri
log.debug( "converting scriptURI="+scriptURI + " to storageURI=" + ret )
return ret
except UnoException as e:
More information about the Libreoffice-commits
mailing list