Copilot commented on code in PR #9976:
URL: https://github.com/apache/ozone/pull/9976#discussion_r3192815624


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -3938,9 +3938,18 @@ public OmMultipartUploadListParts listParts(final String 
volumeName,
       final String bucketName, String keyName, String uploadID,
       int partNumberMarker, int maxParts)  throws IOException {
 
-    ResolvedBucket bucket = resolveBucketLink(Pair.of(volumeName, bucketName));
+    final ResolvedBucket bucket = resolveBucketLink(Pair.of(volumeName, 
bucketName));
+    final String realVolumeName = bucket.realVolume();
+    final String realBucketName = bucket.realBucket();
 
-    Map<String, String> auditMap = bucket.audit();
+    if (getAclsEnabled()) {
+      omMetadataReader.checkAcls(
+          ResourceType.BUCKET, StoreType.OZONE, ACLType.READ, realVolumeName, 
realBucketName, null);
+      omMetadataReader.checkAcls(
+          ResourceType.KEY, StoreType.OZONE, ACLType.READ, realVolumeName, 
realBucketName, keyName);
+    }

Review Comment:
   The new ACL checks run before the audit/metrics try/catch. If 
`omMetadataReader.checkAcls(...)` throws (eg PERMISSION_DENIED), the method 
will return without calling `AUDIT.logReadFailure(...)` and without 
incrementing `incNumListMultipartUploadPartFails()`, which is inconsistent with 
other OM read APIs that audit/log failures from ACL checks. Consider moving the 
ACL checks (and ideally `resolveBucketLink`/`auditMap` creation) inside the 
try/catch, or adding a separate catch for ACL exceptions to ensure failure 
audit logging (and metrics, if desired).



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to