Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c7e42c7

Browse files
committed
parse_ident_usermap() shuold use ereport(LOG) and not ERROR, and put the
return value in the *error_p variable. Noted by Tom.
1 parent d82e9f7 commit c7e42c7

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/backend/libpq/hba.c

+9-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.187 2009/06/21 20:15:32 petere Exp $
13+
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.188 2009/06/24 13:39:42 mha Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -1493,7 +1493,7 @@ parse_ident_usermap(List *line, int line_number, const char *usermap_name,
14931493
char errstr[100];
14941494

14951495
pg_regerror(r, &re, errstr, sizeof(errstr));
1496-
ereport(ERROR,
1496+
ereport(LOG,
14971497
(errcode(ERRCODE_INVALID_REGULAR_EXPRESSION),
14981498
errmsg("invalid regular expression \"%s\": %s", file_ident_user + 1, errstr)));
14991499

@@ -1515,7 +1515,7 @@ parse_ident_usermap(List *line, int line_number, const char *usermap_name,
15151515
{
15161516
/* REG_NOMATCH is not an error, everything else is */
15171517
pg_regerror(r, &re, errstr, sizeof(errstr));
1518-
ereport(ERROR,
1518+
ereport(LOG,
15191519
(errcode(ERRCODE_INVALID_REGULAR_EXPRESSION),
15201520
errmsg("regular expression match for \"%s\" failed: %s", file_ident_user + 1, errstr)));
15211521
*error_p = true;
@@ -1531,10 +1531,15 @@ parse_ident_usermap(List *line, int line_number, const char *usermap_name,
15311531
{
15321532
/* substitution of the first argument requested */
15331533
if (matches[1].rm_so < 0)
1534-
ereport(ERROR,
1534+
{
1535+
ereport(LOG,
15351536
(errcode(ERRCODE_INVALID_REGULAR_EXPRESSION),
15361537
errmsg("regular expression \"%s\" has no subexpressions as requested by backreference in \"%s\"",
15371538
file_ident_user + 1, file_pgrole)));
1539+
pg_regfree(&re);
1540+
*error_p = true;
1541+
return;
1542+
}
15381543

15391544
/*
15401545
* length: original length minus length of \1 plus length of match

0 commit comments

Comments
 (0)