Skip to content
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

Merged
merged 12 commits into from
Jan 8, 2025

Conversation

BruceWong96
Copy link
Contributor

@BruceWong96 BruceWong96 commented Dec 25, 2024

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

@BruceWong96 BruceWong96 changed the title [Fix-16918][Task] Wrong permissions configuration while executing shell [Fix-16918][Task] Fix wrong permissions configuration while executing shell Dec 25, 2024
@SbloodyS SbloodyS added the bug Something isn't working label Dec 26, 2024
@SbloodyS SbloodyS added this to the 3.3.0 milestone Dec 26, 2024
@SbloodyS
Copy link
Member

You should run mvn spotless:apply to format the code. @BruceWong96

@SbloodyS SbloodyS changed the title [Fix-16918][Task] Fix wrong permissions configuration while executing shell [Fix-16918][Task] Fix wrong permissions configuration while executing shell Dec 26, 2024
@BruceWong96
Copy link
Contributor Author

You should run mvn spotless:apply to format the code. @BruceWong96

Finished. Thanks.

@BruceWong96
Copy link
Contributor Author

@caishunfeng @EricGao888 PTAL.

Copy link
Member

@SbloodyS SbloodyS left a 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

This path depends on a
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

This path depends on a
user-provided value
.
}

try {
Files.createDirectory(path);

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression High

This path depends on a
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

This log entry depends on a
user-provided value
.
Copy link

sonarqubecloud bot commented Jan 7, 2025

Copy link
Member

@ruanwenjun ruanwenjun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ruanwenjun ruanwenjun merged commit 890376a into apache:dev Jan 8, 2025
69 of 70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bug Something isn't working document test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] [Task] Wrong permissions configuration while executing shell
3 participants