Quote file paths in Teradata TPT shell commands and pass the openssl passphrase via stdin#69380
Open
potiuk wants to merge 1 commit into
Open
Quote file paths in Teradata TPT shell commands and pass the openssl passphrase via stdin#69380potiuk wants to merge 1 commit into
potiuk wants to merge 1 commit into
Conversation
…passphrase via stdin The Teradata provider's tpt_util.py and encryption_utils.py build several shell commands (run locally or over SSH) that interpolate file paths directly, and pass the openssl passphrase on the command line. Quote the interpolated file paths with shlex.quote() in the POSIX shell commands (shred, the dd/rm fallback, chmod, which, and the openssl -in/-out paths) so paths containing spaces or shell metacharacters are handled correctly, and feed the openssl passphrase on stdin (-pass stdin) for the local generate_encrypted_file_with_openssl so it is not exposed in the local host's process list. Windows command branches and the remote SSH openssl -pass pass: path are left unchanged. Generated-by: Claude Opus 4.8 (1M context) following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The Teradata provider's
tpt_util.pyandencryption_utils.pybuild severalshell commands (run locally or over SSH) that interpolate file paths directly,
and pass the openssl passphrase on the command line.
This hardens both:
shlex.quote()in the POSIX shellcommands (
shred, thedd/rmfallback,chmod,which, and theopenssl … -in/-outpaths), so paths containing spaces or shellmetacharacters are handled correctly and cannot alter the command.
-pass stdin) for the localgenerate_encrypted_file_with_opensslinstead of-pass pass:<…>, so it isnot exposed in the local host's process list.
Windows command branches and the remote SSH
openssl -pass pass:path are leftunchanged (POSIX
shlex.quotedoes not apply tocmd.exe, and moving thepassphrase off argv over the SSH channel would require reworking the shared
remote-exec helper — a larger change).
Tests
are unchanged by
shlex.quote)shred/chmodcommands quote paths with spaces / metacharactersWas generative AI tooling used to co-author this PR?
Generated-by: Claude Opus 4.8 (1M context) following the guidelines at
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions