You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2022/07/27 00:46:42 UTC
[doris] branch dev-1.1.2 updated: [fix](update) check LOAD priv for update stmt (#11099) (#11231)
This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch dev-1.1.2
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/dev-1.1.2 by this push:
new 1474a10d06 [fix](update) check LOAD priv for update stmt (#11099) (#11231)
1474a10d06 is described below
commit 1474a10d068953625639e1c12a1debc058999da9
Author: yiguolei <67...@qq.com>
AuthorDate: Wed Jul 27 08:46:36 2022 +0800
[fix](update) check LOAD priv for update stmt (#11099) (#11231)
Co-authored-by: Mingyu Chen <mo...@gmail.com>
---
.../src/main/java/org/apache/doris/analysis/UpdateStmt.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/UpdateStmt.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/UpdateStmt.java
index b87d514d1b..0d845f9c7c 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/UpdateStmt.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/UpdateStmt.java
@@ -25,7 +25,12 @@ import org.apache.doris.catalog.OlapTable;
import org.apache.doris.catalog.Table;
import org.apache.doris.catalog.Type;
import org.apache.doris.common.AnalysisException;
+import org.apache.doris.common.ErrorCode;
+import org.apache.doris.common.ErrorReport;
import org.apache.doris.common.UserException;
+import org.apache.doris.mysql.privilege.PrivPredicate;
+import org.apache.doris.qe.ConnectContext;
+import org.apache.doris.rewrite.ExprRewriter;
import com.google.common.base.Preconditions;
import org.apache.doris.rewrite.ExprRewriter;
@@ -98,6 +103,13 @@ public class UpdateStmt extends DdlStmt {
private void analyzeTargetTable(Analyzer analyzer) throws AnalysisException {
// step1: analyze table name
tableName.analyze(analyzer);
+
+ // check priv
+ if (!Catalog.getCurrentCatalog().getAuth()
+ .checkTblPriv(ConnectContext.get(), tableName.getDb(), tableName.getTbl(), PrivPredicate.LOAD)) {
+ ErrorReport.reportAnalysisException(ErrorCode.ERR_SPECIFIC_ACCESS_DENIED_ERROR, "LOAD");
+ }
+
// step2: resolve table name with catalog, only unique olap table could be update
String dbName = tableName.getDb();
String targetTableName = tableName.getTbl();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org