Use Java native calls for permissions control #44
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
On hosts that do not have
libHadoop.so
installed, but have SECCOMP enforcement, theexecCommand
chmod
invocation is denied, leading to failures.Solution
Use APIs introduced in Java 7 that enable direct file permission control. They only function on POSIX filesystems, but that's acceptable here because SECCOMP doesn't exist on Windows.
Testing
Re-ran several Spark jobs that invoke this code path when interacting with S3A due to local file copying. SECCOMP violations didn't happen and the job ran normally.
Alternative Solutions in Progress
If either of these solutions can be realized, this commit can be reverted:
libHadoop.so
is installed on relevant hosts. (Infra Support request: https://hubspot.slack.com/archives/C0DGP7SR3/p1707405452982579)