ruanwenjun commented on code in PR #16923:
URL:
https://github.com/apache/dolphinscheduler/pull/16923#discussion_r1897194473
##########
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/FileUtils.java:
##########
@@ -272,6 +271,12 @@ public static void createDirectoryWith755(@NonNull Path
path) throws IOException
}
}
+ public static Path setOwner(@NonNull Path path, @NonNull String owner)
throws IOException {
+ UserPrincipalLookupService lookupService =
FileSystems.getDefault().getUserPrincipalLookupService();
+ UserPrincipal user = lookupService.lookupPrincipalByName(owner);
+ return Files.setOwner(path, user);
Review Comment:
`Files.setOwner` can only be executed by root, this is not expected.
##########
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/utils/TaskExecutionContextUtils.java:
##########
@@ -51,6 +52,9 @@ public static void
createTaskInstanceWorkingDirectory(TaskExecutionContext taskE
taskInstanceWorkingDirectory);
}
FileUtils.createDirectoryWith755(Paths.get(taskInstanceWorkingDirectory));
+ final Path taskInstanceWorkingDirectoryPath =
Paths.get(taskInstanceWorkingDirectory);
Review Comment:
If we change to `775` and make bootstrap user has the same group with
tenant, then tenant will have permission to create file.
--
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]