You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "kerneltime (via GitHub)" <gi...@apache.org> on 2023/02/07 02:01:55 UTC

[GitHub] [ozone] kerneltime commented on a diff in pull request #3971: HDDS-7498. Add permission check when `--user` is specified in `ozone sh volume list`

kerneltime commented on code in PR #3971:
URL: https://github.com/apache/ozone/pull/3971#discussion_r1098098520


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2665,6 +2665,12 @@ public List<OmVolumeArgs> listVolumeByUser(String userName, String prefix,
     try {
       metrics.incNumVolumeLists();
       if (isAclEnabled) {
+        String remoteUserName = remoteUserUgi.getShortUserName();
+        // if not admin nor list my own volumes, check ACL.
+        if (!remoteUserName.equals(userName) && !isAdmin(remoteUserUgi)) {

Review Comment:
   This check is a bit weak the cli param is not guaranteed to use short user name only? 



-- 
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: issues-unsubscribe@ozone.apache.org

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


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