You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2019/12/05 14:32:35 UTC

[GitHub] [incubator-doris] imay commented on a change in pull request #2372: Modify the password and privilege checking logic

imay commented on a change in pull request #2372: Modify the password and privilege checking logic
URL: https://github.com/apache/incubator-doris/pull/2372#discussion_r354343218
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/mysql/privilege/PrivTable.java
 ##########
 @@ -52,28 +61,24 @@ public void addEntry(PrivEntry newEntry, boolean errOnExist, boolean errOnNonExi
             entries.add(newEntry);
             Collections.sort(entries);
             LOG.info("add priv entry: {}", newEntry);
+            return newEntry;
         } else {
             if (errOnExist) {
                 throw new DdlException("User already exist");
             } else {
-                if (!checkOperationAllowed(existingEntry, newEntry, "ADD ENTRY")) {
-                    return;
-                } else {
-                    if (existingEntry.isSetByDomainResolver() && newEntry.isSetByDomainResolver()) {
-                        existingEntry.setPrivSet(newEntry.getPrivSet());
-                        LOG.debug("reset priv entry: {}", existingEntry);
-                    } else if (existingEntry.isSetByDomainResolver() && !newEntry.isSetByDomainResolver()
-                            || !existingEntry.isSetByDomainResolver() && !newEntry.isSetByDomainResolver()) {
-                        mergePriv(existingEntry, newEntry);
-                        existingEntry.setSetByDomainResolver(false);
-                        LOG.info("merge priv entry: {}", existingEntry);
-                    }
-                    return;
+                checkOperationAllowed(existingEntry, newEntry, "ADD ENTRY");
+                if (existingEntry.isSetByDomainResolver() && newEntry.isSetByDomainResolver()) {
+                    existingEntry.setPrivSet(newEntry.getPrivSet());
+                    LOG.debug("reset priv entry: {}", existingEntry);
+                } else if (existingEntry.isSetByDomainResolver() && !newEntry.isSetByDomainResolver()
+                        || !existingEntry.isSetByDomainResolver() && !newEntry.isSetByDomainResolver()) {
 
 Review comment:
   seems that it equal with `!newEntry.isSetByDomainResolver()`

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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