CalvinKirs commented on code in PR #18816: URL: https://github.com/apache/doris/pull/18816#discussion_r1170959955
########## fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/Auth.java: ########## @@ -171,8 +172,8 @@ public void mergeRolesNoCheckName(List<String> roles, Role savedRole) throws Ddl */ public void checkPassword(String remoteUser, String remoteHost, byte[] remotePasswd, byte[] randomString, List<UserIdentity> currentUser) throws AuthenticationException { - if ((remoteUser.equals(ROOT_USER) || remoteUser.equals(ADMIN_USER)) && remoteHost.equals("127.0.0.1")) { - // root and admin user is allowed to login from 127.0.0.1, in case user forget password. + if ((remoteUser.equals(ROOT_USER) || remoteUser.equals(ADMIN_USER)) && Config.skip_auth_check) { Review Comment: I haven't looked at the calling process, but generally speaking, we recommend constant.equals to prevent NPE. it's difficult for us to check whether the caller has done the corresponding null value detection. ``` eg: ROOT_USER.equals(remoteUser) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org