external/hsqldb/patches/disable-dump-script.patch |   46 +++++-----------------
 1 file changed, 12 insertions(+), 34 deletions(-)

New commits:
commit ddf4f82443254d88d9b984c68ed05fa16bb4607a
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Feb 14 20:08:52 2023 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed Feb 15 09:51:22 2023 +0000

    use upstream suggested fix
    
    Change-Id: Ibe61144ea45211aa1b68e51d267ce5b7e1764839
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147026
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

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 {
- 
--        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();
--            }
-         }
-     }
- 
+@@ -403,6 +403,11 @@
+                     throw Trace.error(Trace.INVALID_IDENTIFIER);
+                 }
+ 
++                // 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();

Reply via email to