From ddf4f82443254d88d9b984c68ed05fa16bb4607a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 14 Feb 2023 20:08:52 +0000 Subject: [PATCH] use upstream suggested fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ibe61144ea45211aa1b68e51d267ce5b7e1764839 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147026 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- .../hsqldb/patches/disable-dump-script.patch | 42 +++++-------------- 1 file changed, 10 insertions(+), 32 deletions(-) diff --git a/external/hsqldb/patches/disable-dump-script.patch b/external/hsqldb/patches/disable-dump-script.patch index 13e0213f7e57..401dd38abc9a 100644 --- a/external/hsqldb/patches/disable-dump-script.patch +++ b/external/hsqldb/patches/disable-dump-script.patch @@ -1,36 +1,14 @@ --- a/hsqldb/src/org/hsqldb/DatabaseCommandInterpreter.java 2023-02-13 11:08:11.297243034 +0000 +++ b/hsqldb/src/org/hsqldb/DatabaseCommandInterpreter.java 2023-02-13 13:49:17.973089433 +0000 -@@ -392,31 +392,19 @@ - */ - private Result processScript() throws IOException, HsqlException { +@@ -403,6 +403,11 @@ + throw Trace.error(Trace.INVALID_IDENTIFIER); + } -- String token = tokenizer.getString(); -- ScriptWriterText dsw = null; -+ tokenizer.getString(); - - session.checkAdmin(); - - try { - if (tokenizer.wasValue()) { -- if (tokenizer.getType() != Types.VARCHAR) { -- throw Trace.error(Trace.INVALID_IDENTIFIER); -- } -- -- dsw = new ScriptWriterText(database, token, true, true, true); -- -- dsw.writeAll(); -- -- return new Result(ResultConstants.UPDATECOUNT); -+ throw Trace.error(Trace.ACCESS_IS_DENIED); - } else { - tokenizer.back(); - - return DatabaseScript.getScript(database, false); - } - } finally { -- if (dsw != null) { -- dsw.close(); -- } - } - } ++ // added condition to avoid execution of spurious command in .script or .log file ++ if (session.isProcessingScript() || session.isProcessingLog()) { ++ return new Result(ResultConstants.UPDATECOUNT); ++ } ++ + dsw = new ScriptWriterText(database, token, true, true, true); + dsw.writeAll();