-
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
Conversation
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/FileUtils.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/dolphinscheduler/server/worker/utils/TaskExecutionContextUtils.java
Outdated
Show resolved
Hide resolved
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
Fixed
Show fixed
Hide fixed
@caishunfeng @EricGao888 PTAL. |
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/FileUtils.java
Outdated
Show resolved
Hide resolved
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/utils/FileUtils.java
Show resolved
Hide resolved
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.
LGTM
@@ -289,6 +268,29 @@ | |||
} | |||
} | |||
|
|||
public static void createDirectoryWithPermission(@NonNull Path path, | |||
@NonNull Set<PosixFilePermission> permissions) throws IOException { | |||
if (path.toFile().exists()) { |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression High
user-provided value
Files.createDirectories(path); | ||
} else { | ||
Path parent = path.getParent(); | ||
if (parent != null && !parent.toFile().exists()) { |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression High
user-provided value
} | ||
|
||
try { | ||
Files.createDirectory(path); |
Check failure
Code scanning / CodeQL
Uncontrolled data used in path expression High
user-provided value
Files.createDirectory(path); | ||
Files.setPosixFilePermissions(path, permissions); | ||
} catch (FileAlreadyExistsException fileAlreadyExistsException) { | ||
log.error("The directory: {} already exists", path); |
Check failure
Code scanning / CodeQL
Log Injection High
user-provided value
|
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.
LGTM
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