mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improve WallFilter, support intersectAllow
This commit is contained in:
@@ -45,6 +45,7 @@ public class WallConfig implements WallConfigMBean {
|
||||
private boolean insertAllow = true;
|
||||
private boolean mergeAllow = true;
|
||||
private boolean minusAllow = false;
|
||||
private boolean intersectAllow = false;
|
||||
|
||||
private boolean multiStatementAllow = false;
|
||||
|
||||
@@ -91,10 +92,18 @@ public class WallConfig implements WallConfigMBean {
|
||||
|
||||
}
|
||||
|
||||
public boolean isIntersectAllow() {
|
||||
return intersectAllow;
|
||||
}
|
||||
|
||||
public void setIntersectAllow(boolean intersectAllow) {
|
||||
this.intersectAllow = intersectAllow;
|
||||
}
|
||||
|
||||
public boolean isMinusAllow() {
|
||||
return minusAllow;
|
||||
}
|
||||
|
||||
|
||||
public void setMinusAllow(boolean minusAllow) {
|
||||
this.minusAllow = minusAllow;
|
||||
}
|
||||
|
||||
@@ -753,6 +753,11 @@ public class WallVisitorUtils {
|
||||
return;
|
||||
}
|
||||
|
||||
if (x.getOperator() == SQLUnionOperator.INTERSECT && !visitor.getConfig().isIntersectAllow()) {
|
||||
addViolation(visitor, x);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!visitor.getConfig().isSelectUnionCheck()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user