dineshchitlangia commented on a change in pull request #806: HDDS-3374. 
OMVolumeSetOwnerRequest doesn't check if user is already the owner
URL: https://github.com/apache/hadoop-ozone/pull/806#discussion_r406866343
 
 

 ##########
 File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/OMVolumeSetOwnerRequest.java
 ##########
 @@ -143,6 +143,11 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
 
       oldOwner = omVolumeArgs.getOwnerName();
 
+      if (oldOwner.equals(newOwner)) {
+        throw new OMException("Owner of volume " + volume + " is already " +
+            newOwner, OMException.ResultCodes.ACCESS_DENIED);
+      }
+
 
 Review comment:
   Like previous comment, we can make similar change here too.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org

Reply via email to