Skip to content

Preserve literal passwords in PostgreSQL service files - #1631

Open
jackwalkerlabs wants to merge 1 commit into
dbcli:mainfrom
jackwalkerlabs:fix/service-password-literals-1512
Open

Preserve literal passwords in PostgreSQL service files#1631
jackwalkerlabs wants to merge 1 commit into
dbcli:mainfrom
jackwalkerlabs:fix/service-password-literals-1512

Conversation

@jackwalkerlabs

Copy link
Copy Markdown

Service-file passwords such as abc#def, a,b, and literal quoted values were changed by ConfigObj before connecting. Read the service file with interpolation and inline comments disabled so these values reach the connection unchanged. Leading pre-section comments remain supported, and parser errors retain their original file line numbers.

Fixes #1512. As discussed there, quotes are now literal, matching libpq; the changelog calls out removing quotes previously used only to escape ConfigObj syntax.

Validation: six new regression cases fail on the original code; all seven pass with the change. Full suite against an isolated PostgreSQL 17 instance: 2,784 passed, 1 xfailed, 1 xpassed. Ruff lint and formatting hooks pass. Python 3.12 on macOS.

Implemented and tested using Codex under the submitting account's authorization.

Checklist

  • Added changelog entry.
  • Added submitting account to AUTHORS.
  • Installed pre-commit hooks.
  • Verified behavior and ran tests.
  • Please squash merge.

Fixes dbcli#1512. Implemented and validated with Codex.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pgcli couldn't parse password that contained character '#'

1 participant