You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/06/29 02:57:14 UTC

[GitHub] [cloudstack] lujiefsi commented on a change in pull request #5066: CLOUDSTACK-10436:remind users to use correct permission for tmp dir and fixed an NPE

lujiefsi commented on a change in pull request #5066:
URL: https://github.com/apache/cloudstack/pull/5066#discussion_r660244223



##########
File path: core/src/main/java/com/cloud/storage/JavaStorageLayer.java
##########
@@ -217,6 +229,19 @@ public boolean mkdirs(String path) {
         }
     }
 
+    public boolean isWorldReadable(File file) throws IOException {
+        Set<PosixFilePermission> permissions;
+        permissions = Files.getPosixFilePermissions(
+            Paths.get(file.getAbsolutePath()));
+
+        for (PosixFilePermission permission:permissions) {
+            if (permission.equals(PosixFilePermission.OTHERS_READ)) {
+                return true;
+            }

Review comment:
       have simplified it.




-- 
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: commits-unsubscribe@cloudstack.apache.org

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