diff options
author | Magnus Hagander <magnus@hagander.net> | 2009-06-24 13:39:42 +0000 |
---|---|---|
committer | Magnus Hagander <magnus@hagander.net> | 2009-06-24 13:39:42 +0000 |
commit | c7e42c7ce16e75ca43e027486e1c100024e53170 (patch) | |
tree | 6597597bc200c01c4d96545bd20be8486e1824d5 /src | |
parent | d82e9f72b967dcd0b6c507286e4d552c51a291e1 (diff) | |
download | postgresql-c7e42c7ce16e75ca43e027486e1c100024e53170.tar.gz postgresql-c7e42c7ce16e75ca43e027486e1c100024e53170.zip |
parse_ident_usermap() shuold use ereport(LOG) and not ERROR, and put the
return value in the *error_p variable.
Noted by Tom.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/libpq/hba.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c index 53d3d3b07e6..27e0c431ca8 100644 --- a/src/backend/libpq/hba.c +++ b/src/backend/libpq/hba.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.187 2009/06/21 20:15:32 petere Exp $ + * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.188 2009/06/24 13:39:42 mha Exp $ * *------------------------------------------------------------------------- */ @@ -1493,7 +1493,7 @@ parse_ident_usermap(List *line, int line_number, const char *usermap_name, char errstr[100]; pg_regerror(r, &re, errstr, sizeof(errstr)); - ereport(ERROR, + ereport(LOG, (errcode(ERRCODE_INVALID_REGULAR_EXPRESSION), errmsg("invalid regular expression \"%s\": %s", file_ident_user + 1, errstr))); @@ -1515,7 +1515,7 @@ parse_ident_usermap(List *line, int line_number, const char *usermap_name, { /* REG_NOMATCH is not an error, everything else is */ pg_regerror(r, &re, errstr, sizeof(errstr)); - ereport(ERROR, + ereport(LOG, (errcode(ERRCODE_INVALID_REGULAR_EXPRESSION), errmsg("regular expression match for \"%s\" failed: %s", file_ident_user + 1, errstr))); *error_p = true; @@ -1531,10 +1531,15 @@ parse_ident_usermap(List *line, int line_number, const char *usermap_name, { /* substitution of the first argument requested */ if (matches[1].rm_so < 0) - ereport(ERROR, + { + ereport(LOG, (errcode(ERRCODE_INVALID_REGULAR_EXPRESSION), errmsg("regular expression \"%s\" has no subexpressions as requested by backreference in \"%s\"", file_ident_user + 1, file_pgrole))); + pg_regfree(&re); + *error_p = true; + return; + } /* * length: original length minus length of \1 plus length of match |