You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "CalvinKirs (via GitHub)" <gi...@apache.org> on 2023/04/19 07:54:54 UTC

[GitHub] [doris] CalvinKirs commented on a diff in pull request #18816: [Enchancement](auth) Forbid to login doris from 127.0.0.1 without password

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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org