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

Adding a ";" (semi-colon) as part of the value breaks the tools output #7

Closed
NathanaelA opened this issue Jul 14, 2021 · 8 comments
Closed

Comments

@NathanaelA
Copy link

NathanaelA commented Jul 14, 2021

Trying to create a PR for the postgresql pgbouncer image of yours for the auth_query value I ran into this issue...

doing a
ini-file --section "section" -- key "key" --value "test;" ./test.ini
will create file that looks like:

[section]
key=`test;`

it back-ticks the value, which seems to break some ini-parsers like the pgbouncer ini parser

I expected:

[section]
key=test;
@pablogalegoc
Copy link

Hi @NathanaelA!

If you can temporarily workaround it, could you link to this issue once you open the PR on pgbouncer? This way we have the full context and can reproduce your problem 🙂

@NathanaelA
Copy link
Author

The above CLI command I provided will show you the issue. Just run it and you should see the key value will have back ticks around it....


The only way to work around it currently that I'm using in my own replacement version of the libpgbouncer.sh script in a "from" image is just a:

echo -n 'auth_query=SELECT * FROM public.user_lookup($1);' >> "$PGBOUNCER_CONF_FILE" as ini-file has no valid work around that I could find, I tried different quoting methods and it just wants to put the back ticks into the value...

This is added as the last line in the libpgbouncer.sh file in the if ! pgbouncer_is_file_external "pgbouncer.ini"; then statement since we already have to replace the the libpgbouncer.sh file do to open issue https://github.com/bitnami/bitnami-docker-pgbouncer/issues/4 stopping any additional custom scripts from being called/ran...

@pablogalegoc
Copy link

I thought this issue was somewhat blocking the proposed PR for pgbouncer but I see they are independent.
I'm going to cc/ @juamedgod since he surely can provide a fix for this.

@juamedgod
Copy link
Contributor

@NathanaelA

I pushed #9 with a cli flag to allow disabling the behavior by ignoring inline comments (which removes the special meaning of the semicolon). Could you check if that helps with your issue?

ini-file --ignore-inline-comments  --section "section" -- key "key" --value "test;" ./test.ini

@NathanaelA
Copy link
Author

@pablogalegoc - Actually it was/is blocking a new PR for pgbouncer that I haven't finished. If this change fixes the ini issue, then I'll be putting a PR up for the auth_query... But I was just trying to show the issue, via the CLI as it is a lot easier to debug when you have a solid method without having to also spin up a docker container. ;-)

@NathanaelA
Copy link
Author

@juamedgod - Is there a release/RC version of this with this change that I can test, or do I have to build it?

@juamedgod
Copy link
Contributor

You can grab it from the artifacts in the Circle CI run from the PR:

https://app.circleci.com/pipelines/github/bitnami/ini-file/23/workflows/2f71f9d3-2e78-45c7-a45a-495ac132b551/jobs/23/artifacts

Here is a direct link to the artifact:

https://23-150459371-gh.circle-artifacts.com/0/ini-file

@marcosbc
Copy link
Contributor

marcosbc commented Nov 9, 2022

Hi all, I'm going to close this issue due to inactivity but feel free to send a contribution if are open to contribute any related feature.

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

No branches or pull requests

4 participants