Copilot commented on code in PR #10859:
URL: https://github.com/apache/ozone/pull/10859#discussion_r3648748166
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -3078,6 +3080,18 @@ private OmBucketInfo getResolvedSourceBucket(
return cachedSource;
}
}
+ if (getAclsEnabled()) {
+ try {
+ omMetadataReader.checkAcls(ResourceType.BUCKET, StoreType.OZONE,
+ ACLType.READ, resolvedBucket.realVolume(),
+ resolvedBucket.realBucket(), null);
+ } catch (OMException e) {
+ if (e.getResult() == PERMISSION_DENIED) {
+ return null;
+ }
+ throw e;
Review Comment:
The PR description says `getBucketInfo` should propagate `PERMISSION_DENIED`
when the caller cannot READ the resolved source bucket, but this change
explicitly swallows `PERMISSION_DENIED` and returns `null` (which causes link
enrichment to be skipped and `getBucketInfo` to return the original link
bucket). The new unit test
`testGetBucketInfoReturnsLinkWithoutSourceReadAccess` also asserts this
non-throwing behavior.
Please align behavior and documentation: either update the PR description
(and/or test names) to reflect “skip enrichment on source READ denied”, or
change the implementation so `getBucketInfo` throws on source READ denied while
`listBuckets` continues with the raw link entry.
--
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]