elharo commented on code in PR #97:
URL: https://github.com/apache/maven-filtering/pull/97#discussion_r1504163149


##########
src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java:
##########
@@ -371,6 +375,23 @@ private static void copyFilePermissions(File source, File 
destination) throws IO
         }
     }
 
+    @SuppressWarnings("ResultOfMethodCallIgnored")
+    private static void setAllPermissions(File file) throws IOException {
+        if (file.exists()) {
+            try {
+                Files.setPosixFilePermissions(
+                        file.toPath(),
+                        EnumSet.of(
+                                PosixFilePermission.OWNER_READ, 
PosixFilePermission.OWNER_WRITE,
+                                PosixFilePermission.GROUP_READ, 
PosixFilePermission.GROUP_WRITE,
+                                PosixFilePermission.OTHERS_READ, 
PosixFilePermission.OTHERS_WRITE));

Review Comment:
   I think the copied file is now world readable and writable when everything 
completes. That might leave arbitrary world writable files sitting around in 
the file system, which feels risky. Can this work without world or even group 
permissions? And/or can the file be set back to owner only after the copy 
finishes?
   
   



##########
src/main/java/org/apache/maven/shared/filtering/FilteringUtils.java:
##########
@@ -371,6 +375,23 @@ private static void copyFilePermissions(File source, File 
destination) throws IO
         }
     }
 
+    @SuppressWarnings("ResultOfMethodCallIgnored")
+    private static void setAllPermissions(File file) throws IOException {

Review Comment:
   makeWriteable as it no longer sets all permissions



-- 
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]

Reply via email to