RANGER-5631: Fix setup scripts failing on passwords containing % and \#1069
Open
arunk-kumar wants to merge 1 commit into
Open
RANGER-5631: Fix setup scripts failing on passwords containing % and \#1069arunk-kumar wants to merge 1 commit into
arunk-kumar wants to merge 1 commit into
Conversation
The db_setup and dba_script utilities failed on any password containing
the character % (ConfigParser interpolation error) or one of the
characters \ ` ' " (rejected by a denylist regex before reaching the DB).
Fixes:
1. Switch to ConfigParser(interpolation=None) in unixauthservice/scripts/setup.py
so % in property values is read literally.
2. Drop the [\`'"] regex denylist on Unix; shell-quote passwords via
shlex.quote() at every jisql call site instead. On Windows retain a
targeted "-only denylist until a dedicated cmd.exe quoter is added.
3. Apply shlex.quote() to every Unix get_jisql_cmd() branch across
MySQL, Oracle, Postgres, MSSQL, and SQLAnywhere in security-admin
and kms scripts.
Verified locally with a Python smoke test that round-trips 18 problem
passwords (including P@$s%wo\rd'"!, $(rm -rf /), backticks, spaces, and
starting-dash arg-injection attempts) through the ConfigParser and
shlex.quote -> shlex.split -> subprocess pipeline. Full mvn -T 8 clean
verify passes (all 90 modules green).
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.
Summary
Fixes RANGER-5631. Setup and DB scripts fail on any password containing percent, backslash, backtick, single quote, or double quote.
Root cause
Fix
Testing