Gargi-jais11 commented on code in PR #9735:
URL: https://github.com/apache/ozone/pull/9735#discussion_r2785977937
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/StorageVolume.java:
##########
@@ -768,11 +781,30 @@ private static SpaceUsageCheckParams
getSpaceUsageCheckParams(Builder b, Supplie
throw new IOException("Unable to create the volume root dir at " + root);
}
+ // Set permissions on volume root directory immediately after
creation/check
+ // (for data volumes, we want to ensure the root has secure permissions,
+ // even if the directory already existed from a previous run)
+ // This follows the same pattern as metadata directories in
getDirectoryFromConfig()
+ if (b.conf != null && root.exists() &&
HDDS_VOLUME_DIR.equals(b.getStorageDirStr())) {
+ ServerUtils.setDataDirectoryPermissions(root, b.conf,
+ ScmConfigKeys.HDDS_DATANODE_DATA_DIR_PERMISSIONS);
+ }
+
SpaceUsageCheckFactory usageCheckFactory = b.usageCheckFactory;
if (usageCheckFactory == null) {
usageCheckFactory = SpaceUsageCheckFactory.create(b.conf);
}
return usageCheckFactory.paramsFor(root, exclusionProvider);
}
+
+ /**
+ * Sets permissions on the storage directory (e.g., hdds subdirectory).
+ */
+ private void setStorageDirPermissions() {
Review Comment:
Now permission is only set for storagetype. DATA_VOLUME
--
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]