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

Last configuration line ignored if no new line at the end of file #230

Closed
fluca1978 opened this issue May 6, 2022 · 0 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@fluca1978
Copy link
Collaborator

Running version 1.5.0.
If the configuration file does not contain a new file char at the end, the last line is ignored.
I discovered this while working on #227 because the system was not loading the primary hint from my replica configuration:

$ cat /etc/pgagroal/pgagroal.conf
...
[spengler]
host = spengler
port = 5432
primary = on$

while having the configuration file with an empty new line at the bottom makes it working:

$ cat /etc/pgagroal/pgagroal.conf
...
...
[spengler]
host = spengler
port = 5432
primary = on 
$
@fluca1978 fluca1978 added the bug Something isn't working label May 6, 2022
fluca1978 added a commit to fluca1978/pgagroal that referenced this issue May 6, 2022
…-line

In the case the main configuration file has no new line in it, the
line is ignored by the function `extract_key_value()`.
This can be a little tricky, since the line is ignored and the user
has no clue about it.
With this fix, the last line of `pgagroal.conf` is always interpreted
even if no new line is present.

Fixes the same problem even for `pgagroal_hba.conf` file read within `extract_hba`.

Clse agroal#230
jesperpedersen pushed a commit that referenced this issue May 6, 2022
In the case the main configuration file has no new line in it, the
line is ignored by the function `extract_key_value()`.
This can be a little tricky, since the line is ignored and the user
has no clue about it.
With this fix, the last line of `pgagroal.conf` is always interpreted
even if no new line is present.

Fixes the same problem even for `pgagroal_hba.conf` file read within `extract_hba`.

Clse #230
jesperpedersen pushed a commit that referenced this issue May 6, 2022
In the case the main configuration file has no new line in it, the
line is ignored by the function `extract_key_value()`.
This can be a little tricky, since the line is ignored and the user
has no clue about it.
With this fix, the last line of `pgagroal.conf` is always interpreted
even if no new line is present.

Fixes the same problem even for `pgagroal_hba.conf` file read within `extract_hba`.

Clse #230
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants