summaryrefslogtreecommitdiff
path: root/src/include/libpq/hba.h
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2025-11-28 07:53:12 +0100
committerPeter Eisentraut <peter@eisentraut.org>2025-11-28 08:33:07 +0100
commit8b3e2c622a85208b94808c54d9b40b10b030d304 (patch)
tree0c96c31fc19dc50a76ba7b5db41fa61002c49835 /src/include/libpq/hba.h
parente68b6adad96d414fdf24e072fdb1d41fb4b8f0b7 (diff)
Fix pg_isblank()
There was a pg_isblank() function that claimed to be a replacement for the standard isblank() function, which was thought to be "not very portable yet". We can now assume that it's portable (it's in C99). But pg_isblank() actually diverged from the standard isblank() by also accepting '\r', while the standard one only accepts space and tab. This was added to support parsing pg_hba.conf under Windows. But the hba parsing code now works completely differently and already handles line endings before we get to pg_isblank(). The other user of pg_isblank() is for ident protocol message parsing, which also handles '\r' separately. So this behavior is now obsolete and confusing. To improve clarity, I separated those concerns. The ident parsing now gets its own function that hardcodes the whitespace characters mentioned by the relevant RFC. pg_isblank() is now static in hba.c and is a wrapper around the standard isblank(), with some extra logic to ensure robust treatment of non-ASCII characters. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://www.postgresql.org/message-id/flat/170308e6-a7a3-4484-87b2-f960bb564afa%40eisentraut.org
Diffstat (limited to 'src/include/libpq/hba.h')
-rw-r--r--src/include/libpq/hba.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/include/libpq/hba.h b/src/include/libpq/hba.h
index e3748d3c8c9..7b93ba4a709 100644
--- a/src/include/libpq/hba.h
+++ b/src/include/libpq/hba.h
@@ -181,7 +181,6 @@ extern int check_usermap(const char *usermap_name,
bool case_insensitive);
extern HbaLine *parse_hba_line(TokenizedAuthLine *tok_line, int elevel);
extern IdentLine *parse_ident_line(TokenizedAuthLine *tok_line, int elevel);
-extern bool pg_isblank(const char c);
extern FILE *open_auth_file(const char *filename, int elevel, int depth,
char **err_msg);
extern void free_auth_file(FILE *file, int depth);