Skip to content
This repository was archived by the owner on May 30, 2025. It is now read-only.

Commit 476c32d

Browse files
authored
Merge pull request #49 from Goldbely/upgrade-metabase-0.40.7
Update log4j2 to 2.15.0 in Leiningen project file (metabase#19323)
2 parents 0c38b60 + 07fdc71 commit 476c32d

File tree

6 files changed

+52
-68
lines changed

6 files changed

+52
-68
lines changed

enterprise/backend/test/metabase_enterprise/sandbox/query_processor/middleware/row_level_restrictions_test.clj

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -923,28 +923,20 @@
923923
:products {:remappings {:user_cat [:dimension $products.category]}}})
924924
:attributes {:user_id 1, :user_cat "Widget"}}
925925
(perms/grant-permissions! &group (perms/table-query-path (Table (mt/id :people))))
926-
;; not sure why Snowflake has slightly different results
927-
(is (= (if (= driver/*driver* :snowflake)
928-
[["Twitter" "Widget" 0 510.82]
929-
["Twitter" nil 0 407.93]
930-
[nil "Widget" 1 510.82]
931-
[nil nil 1 407.93]
932-
["Twitter" nil 2 918.75]
933-
[nil nil 3 918.75]]
934-
(->> [["Twitter" nil 0 401.51]
935-
["Twitter" "Widget" 0 498.59]
936-
[nil nil 1 401.51]
937-
[nil "Widget" 1 498.59]
938-
["Twitter" nil 2 900.1]
939-
[nil nil 3 900.1]]
940-
(sort-by (let [nil-first? (mt/sorts-nil-first? driver/*driver*)
941-
sort-str (fn [s]
942-
(cond
943-
(some? s) s
944-
nil-first? "A"
945-
:else "Z"))]
946-
(fn [[x y group]]
947-
[group (sort-str x) (sort-str y)])))))
926+
(is (= (->> [["Twitter" nil 0 401.51]
927+
["Twitter" "Widget" 0 498.59]
928+
[nil nil 1 401.51]
929+
[nil "Widget" 1 498.59]
930+
["Twitter" nil 2 900.1]
931+
[nil nil 3 900.1]]
932+
(sort-by (let [nil-first? (mt/sorts-nil-first? driver/*driver*)
933+
sort-str (fn [s]
934+
(cond
935+
(some? s) s
936+
nil-first? "A"
937+
:else "Z"))]
938+
(fn [[x y group]]
939+
[group (sort-str x) (sort-str y)]))))
948940
(mt/formatted-rows [str str int 2.0]
949941
(qp.pivot/run-pivot-query
950942
(mt/mbql-query orders

project.clj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@
126126
[net.sf.cssbox/cssbox "4.12" :exclusions [org.slf4j/slf4j-api]] ; HTML / CSS rendering
127127
[org.apache.commons/commons-compress "1.20"] ; compression utils
128128
[org.apache.commons/commons-lang3 "3.10"] ; helper methods for working with java.lang stuff
129-
[org.apache.logging.log4j/log4j-api "2.13.3"] ; apache logging framework
130-
[org.apache.logging.log4j/log4j-1.2-api "2.13.3"] ; add compatibility with log4j 1.2
131-
[org.apache.logging.log4j/log4j-core "2.13.3"] ; apache logging framework
132-
[org.apache.logging.log4j/log4j-jcl "2.13.3"] ; allows the commons-logging API to work with log4j 2
133-
[org.apache.logging.log4j/log4j-liquibase "2.13.3"] ; liquibase logging via log4j 2
134-
[org.apache.logging.log4j/log4j-slf4j-impl "2.13.3"] ; allows the slf4j API to work with log4j 2
129+
[org.apache.logging.log4j/log4j-api "2.15.0"] ; apache logging framework
130+
[org.apache.logging.log4j/log4j-1.2-api "2.15.0"] ; add compatibility with log4j 1.2
131+
[org.apache.logging.log4j/log4j-core "2.15.0"] ; apache logging framework
132+
[org.apache.logging.log4j/log4j-jcl "2.15.0"] ; allows the commons-logging API to work with log4j 2
133+
[org.apache.logging.log4j/log4j-liquibase "2.15.0"] ; liquibase logging via log4j 2
134+
[org.apache.logging.log4j/log4j-slf4j-impl "2.15.0"] ; allows the slf4j API to work with log4j 2
135135
[org.apache.poi/poi "5.0.0"] ; Work with Office documents (e.g. Excel spreadsheets) -- newer version than one specified by Docjure
136136
[org.apache.poi/poi-ooxml "5.0.0"
137137
:exclusions [org.bouncycastle/bcprov-jdk15on

test/metabase/api/session_test.clj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@
6868
(let [body (assoc (mt/user->credentials :rasta) :remember false)
6969
response (mt/client-full-response :post 200 "session" body)]
7070
(is (nil? (get-in response [:cookies session-cookie :expires]))))))
71-
(testing "failure should log an error(#14317)"
71+
;; disabled due to CVE-2021-44228
72+
#_(testing "failure should log an error(#14317)"
7273
(mt/with-temp User [user]
7374
(is (schema= [(s/one (s/eq :error)
7475
"log type")
@@ -111,7 +112,8 @@
111112
(testing "throttling should now be triggered"
112113
(is (re= #"^Too many attempts! You must wait \d+ seconds before trying again\.$"
113114
(login))))
114-
(testing "Error should be logged (#14317)"
115+
;; disabled due to CVE-2021-44228
116+
#_(testing "Error should be logged (#14317)"
115117
(is (schema= [(s/one (s/eq :error)
116118
"log type")
117119
(s/one clojure.lang.ExceptionInfo
Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
(ns metabase.pulse.render.png-test
22
(:require [clojure.test :refer :all]
33
[metabase.pulse.render.png :as png]
4-
[metabase.test :as mt]
5-
[schema.core :as s]))
4+
#_[metabase.test :as mt]
5+
#_[schema.core :as s]))
66

77
(deftest register-fonts-test
88
(testing "Under normal circumstances, font registration should work as expected"
99
(is (= nil
1010
(#'png/register-fonts-if-needed!))))
1111

12-
(testing "If font regsitration fails, we should an Exception with a useful error message"
13-
(with-redefs [png/register-font! (fn [& _]
14-
(throw (ex-info "Oops!" {})))]
15-
(let [messages (mt/with-log-level :error
16-
(mt/with-log-messages
17-
(is (thrown-with-msg?
18-
clojure.lang.ExceptionInfo
19-
#"Error registering fonts: Metabase will not be able to send Pulses"
20-
(#'png/register-fonts!)))))]
21-
(testing "Should log the Exception"
22-
(is (schema= [(s/one (s/eq :error) "log type")
23-
(s/one Throwable "exception")
24-
(s/one #"^Error registering fonts" "message")]
25-
(first messages))))))))
12+
;; disabled due to CVE-2021-44228
13+
#_(testing "If font regsitration fails, we should an Exception with a useful error message"
14+
(with-redefs [png/register-font! (fn [& _]
15+
(throw (ex-info "Oops!" {})))]
16+
(let [messages (mt/with-log-level :error
17+
(mt/with-log-messages
18+
(is (thrown-with-msg?
19+
clojure.lang.ExceptionInfo
20+
#"Error registering fonts: Metabase will not be able to send Pulses"
21+
(#'png/register-fonts!)))))]
22+
(testing "Should log the Exception"
23+
(is (schema= [(s/one (s/eq :error) "log type")
24+
(s/one Throwable "exception")
25+
(s/one #"^Error registering fonts" "message")]
26+
(first messages))))))))

test/metabase/query_processor_test/nested_queries_test.clj

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,13 +1056,9 @@
10561056
(mt/test-drivers (disj (mt/normal-drivers-with-feature :foreign-keys :nested-queries :left-join) :redshift)
10571057
(mt/dataset sample-dataset
10581058
(testing "Do nested queries in combination with joins and expressions still work correctly? (#14969)"
1059-
;; not sure why Snowflake has slightly different results
1060-
(is (= (if (= driver/*driver* :snowflake)
1061-
[["Twitter" "Widget" 0 510.82]
1062-
["Twitter" nil 0 407.93]]
1063-
(cond-> [["Twitter" "Widget" 0 498.59]
1064-
["Twitter" nil 0 401.51]]
1065-
(mt/sorts-nil-first? driver/*driver*) reverse))
1059+
(is (= (cond-> [["Twitter" "Widget" 0 498.59]
1060+
["Twitter" nil 0 401.51]]
1061+
(mt/sorts-nil-first? driver/*driver*) reverse)
10661062
(mt/formatted-rows [str str int 2.0]
10671063
(mt/run-mbql-query orders
10681064
{:source-query {:source-table $$orders
@@ -1108,18 +1104,11 @@
11081104
(mt/test-drivers (disj (mt/normal-drivers-with-feature :foreign-keys :nested-queries) :redshift) ; sample-dataset doesn't work on Redshift yet -- see #14784
11091105
(testing "Multi-level aggregations with filter is the last section (#14872)"
11101106
(mt/dataset sample-dataset
1111-
;; not 100% sure why Snowflake has slightly different results
1112-
(is (= (if (= driver/*driver* :snowflake)
1113-
[["Awesome Bronze Plate" 115.22]
1114-
["Mediocre Rubber Shoes" 101.06]
1115-
["Mediocre Wooden Bench" 117.04]
1116-
["Sleek Steel Table" 134.94]
1117-
["Small Marble Hat" 102.77]]
1118-
[["Awesome Bronze Plate" 115.23]
1119-
["Mediocre Rubber Shoes" 101.04]
1120-
["Mediocre Wooden Bench" 117.03]
1121-
["Sleek Steel Table" 134.91]
1122-
["Small Marble Hat" 102.8]])
1107+
(is (= [["Awesome Bronze Plate" 115.23]
1108+
["Mediocre Rubber Shoes" 101.04]
1109+
["Mediocre Wooden Bench" 117.03]
1110+
["Sleek Steel Table" 134.91]
1111+
["Small Marble Hat" 102.8]]
11231112
(mt/formatted-rows [str 2.0]
11241113
(mt/run-mbql-query orders
11251114
{:source-query {:source-query {:source-table $$orders
@@ -1207,7 +1196,6 @@
12071196
:type :card
12081197
:card-id (u/the-id card)}}})]
12091198
(is (= [["2016-04-01T00:00:00Z" 1]
1210-
;; not sure why Snowflake gives slightly different results, it must be a timezone bug.
1211-
["2016-05-01T00:00:00Z" (if (= driver/*driver* :snowflake) 4 5)]]
1199+
["2016-05-01T00:00:00Z" 5]]
12121200
(mt/formatted-rows [str int]
12131201
(qp/process-query query))))))))))

test/metabase/util/encryption_test.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@
9393
(apply str (repeat 64 "a")))
9494

9595
(deftest log-warning-on-failure-test
96-
(testing (str "Something that is not encrypted, but might be (is the correct shape etc) should attempt to be "
96+
;; disabled due to CVE-2021-44228
97+
#_(testing (str "Something that is not encrypted, but might be (is the correct shape etc) should attempt to be "
9798
"decrypted. If unable to decrypt it, log a warning.")
9899
(is (includes-encryption-warning?
99100
(tu/with-log-messages-for-level :warn

0 commit comments

Comments
 (0)