[fix](auth)fix not display be_port (#25197)

fix not display be_port who has ADMIN_PRIV
This commit is contained in:
zhangdong
2023-10-13 11:56:00 +08:00
committed by GitHub
parent 509a79988e
commit 4f65a9c425
4 changed files with 43 additions and 16 deletions

View File

@ -58,8 +58,6 @@ public class BackendsProcDir implements ProcDirInterface {
.add("TotalCapacity").add("UsedCapacity").add("AvailableCapacity").add("UsedPct")
.build();
public static final int HOSTNAME_INDEX = 3;
private SystemInfoService systemInfoService;
public BackendsProcDir(SystemInfoService systemInfoService) {

View File

@ -682,19 +682,6 @@ public class ShowExecutor {
ProcNodeInterface procNode = showProcStmt.getNode();
List<List<String>> finalRows = procNode.fetchResult().getRows();
// if this is superuser, hide ip and host info form backends info proc
if (procNode instanceof BackendsProcDir) {
if (!Env.getCurrentEnv().getAccessManager().checkGlobalPriv(ConnectContext.get(), PrivPredicate.OPERATOR)) {
// hide host info
for (List<String> row : finalRows) {
row.remove(BackendsProcDir.HOSTNAME_INDEX);
}
// mod meta data
metaData.removeColumn(BackendsProcDir.HOSTNAME_INDEX);
}
}
resultSet = new ShowResultSet(metaData, finalRows);
}