-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix-16918][Task] Fix wrong permissions configuration while executing shell #16923
base: dev
Are you sure you want to change the base?
Conversation
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/FileUtils.java
Outdated
Show resolved
Hide resolved
@@ -51,6 +52,9 @@ public static void createTaskInstanceWorkingDirectory(TaskExecutionContext taskE | |||
taskInstanceWorkingDirectory); | |||
} | |||
FileUtils.createDirectoryWith755(Paths.get(taskInstanceWorkingDirectory)); | |||
final Path taskInstanceWorkingDirectoryPath = Paths.get(taskInstanceWorkingDirectory); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we change to 775
and make bootstrap user has the same group with tenant, then tenant will have permission to create file at working directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we change to
775
and make bootstrap user has the same group with tenant, then tenant will have permission to create file at working directory.
So, can i create a function createDirectoryWith775() and call it here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can. cc @caishunfeng, @SbloodyS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with this. If we change the task instance working directory to 775, we should add it to the installation docs to tell users add tenant to ds user's group.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SbloodyS
Which part of the document should I update?
Also, please review the code i just committed.
Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/FileUtils.java
Outdated
Show resolved
Hide resolved
You should run |
Finished. Thanks. |
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/FileUtils.java
Dismissed
Show dismissed
Hide dismissed
Please retry analysis of this Pull-Request directly on SonarQube Cloud |
@caishunfeng @EricGao888 PTAL. |
} else { | ||
Path parent = path.getParent(); | ||
if (parent != null && !parent.toFile().exists()) { | ||
createDirectoryWith755(parent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createDirectoryWith755(parent); | |
createDirectoryWith775(parent); |
Can we unify the method createDirectoryWith755
? these two method has the same logic.
We can create a new method createDirectory(@nonnull Path path, Set permissions);
Purpose of the pull request
close #16918
Brief change log
Verify this pull request
This pull request is code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(or)
Pull Request Notice
Pull Request Notice
If your pull request contain incompatible change, you should also add it to
docs/docs/en/guide/upgrede/incompatible.md