This is an automated email from the ASF dual-hosted git repository.
swamirishi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new 20c84d87e7 HDDS-10434. Added permission check for snapshotDiff related
operations (#6505)
20c84d87e7 is described below
commit 20c84d87e78fe7fda7c924a23a61343ff1bc61c1
Author: Hemant Kumar <[email protected]>
AuthorDate: Tue Apr 16 17:23:51 2024 -0700
HDDS-10434. Added permission check for snapshotDiff related operations
(#6505)
---
.../org/apache/hadoop/ozone/om/OzoneManager.java | 26 ++++++++++++++++------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
index 680ebe0631..9a67fed126 100644
---
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
+++
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
@@ -4785,9 +4785,13 @@ public final class OzoneManager extends
ServiceRuntimeInfoImpl
boolean forceFullDiff,
boolean disableNativeDiff)
throws IOException {
- return omSnapshotManager.getSnapshotDiffReport(volume, bucket,
- fromSnapshot, toSnapshot, token, pageSize, forceFullDiff,
- disableNativeDiff);
+
+ if (isAclEnabled) {
+ omMetadataReader.checkAcls(ResourceType.BUCKET, StoreType.OZONE,
ACLType.READ, volume, bucket, null);
+ }
+
+ return omSnapshotManager.getSnapshotDiffReport(volume, bucket,
fromSnapshot, toSnapshot,
+ token, pageSize, forceFullDiff, disableNativeDiff);
}
public CancelSnapshotDiffResponse cancelSnapshotDiff(String volume,
@@ -4795,8 +4799,12 @@ public final class OzoneManager extends
ServiceRuntimeInfoImpl
String fromSnapshot,
String toSnapshot)
throws IOException {
- return omSnapshotManager.cancelSnapshotDiff(volume, bucket,
- fromSnapshot, toSnapshot);
+
+ if (isAclEnabled) {
+ omMetadataReader.checkAcls(ResourceType.BUCKET, StoreType.OZONE,
ACLType.READ, volume, bucket, null);
+ }
+
+ return omSnapshotManager.cancelSnapshotDiff(volume, bucket, fromSnapshot,
toSnapshot);
}
public List<SnapshotDiffJob> listSnapshotDiffJobs(String volume,
@@ -4804,8 +4812,12 @@ public final class OzoneManager extends
ServiceRuntimeInfoImpl
String jobStatus,
boolean listAll)
throws IOException {
- return omSnapshotManager.getSnapshotDiffList(volume,
- bucket, jobStatus, listAll);
+
+ if (isAclEnabled) {
+ omMetadataReader.checkAcls(ResourceType.BUCKET, StoreType.OZONE,
ACLType.LIST, volume, bucket, null);
+ }
+
+ return omSnapshotManager.getSnapshotDiffList(volume, bucket, jobStatus,
listAll);
}
public String printCompactionLogDag(String fileNamePrefix,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]