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

Line number in structure limits but not in hba? #355

Closed
fluca1978 opened this issue Mar 22, 2023 · 3 comments
Closed

Line number in structure limits but not in hba? #355

fluca1978 opened this issue Mar 22, 2023 · 3 comments

Comments

@fluca1978
Copy link
Collaborator

While working on #239, I noted that the struct limit has a line number field https://github.com/agroal/pgagroal/blob/master/src/include/pgagroal.h#L291 while other similar structures, most notably struct hba does not.
The line number is useful to report back errors in the configuration, e.g., https://github.com/agroal/pgagroal/blob/master/src/libpgagroal/configuration.c#L1303.

In order to keep everything consistent, I would like to either remove the line number or to add it in similar structures, at leas in struct hba.

@jesperpedersen
Copy link
Collaborator

I think it would be good to have line numbers for all configuration files

@fluca1978
Copy link
Collaborator Author

I think it would be good to have line numbers for all configuration files

Agree.
This means adding a lineno field in all structures, including config.

@jesperpedersen
Copy link
Collaborator

👍

fluca1978 added a commit to fluca1978/pgagroal that referenced this issue Mar 27, 2023
Adds a `lineno` field to the configuration structs:
- `struct hba`
- `struct configuration`

Thanks to this, it is possible to provide better messages to the users
about misconfigurations.
For example, if the user mispells an entry into the HBA file:

```
FATAL configuration.c:1162 Unknown HBA type: HOSTSS (/etc/pgagroal/pgagroal_hba.conf:7)
```
fluca1978 added a commit to fluca1978/pgagroal that referenced this issue Mar 27, 2023
Added a `lineno` field into structures `struct hba` and `struct
server`.
This simplifies error reporting, since it is now possible to drive the
user to the line number that is causing a problem.

Changes to a few log/warn messages to become more easy to read.

Close agroal#355
fluca1978 added a commit to fluca1978/pgagroal that referenced this issue Mar 27, 2023
Added a `lineno` field into structures `struct hba` and `struct
server`.
This simplifies error reporting, since it is now possible to drive the
user to the line number that is causing a problem.

Thanks to this, it is possible to provide better messages to the users
about misconfigurations.
For example, if the user mispells an entry into the HBA file:

```
FATAL configuration.c:1162 Unknown HBA type: HOSTSS (/etc/pgagroal/pgagroal_hba.conf:7)
```

Changes to a few log/warn messages to become more easy to read.

Close agroal#355
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 a pull request may close this issue.

2 participants