*** pgsql/src/backend/libpq/hba.c 2009/03/07 21:28:00 1.183 --- pgsql/src/backend/libpq/hba.c 2009/03/25 14:12:02 1.184 *************** *** 10,16 **** * * * IDENTIFICATION ! * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.182 2009/03/04 18:43:38 mha Exp $ * *------------------------------------------------------------------------- */ --- 10,16 ---- * * * IDENTIFICATION ! * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.183 2009/03/07 21:28:00 mha Exp $ * *------------------------------------------------------------------------- */ *************** check_db(const char *dbname, const char *** 578,584 **** #define INVALID_AUTH_OPTION(optname, validmethods) do {\ ereport(LOG, \ (errcode(ERRCODE_CONFIG_FILE_ERROR), \ ! errmsg("authentication option '%s' is only valid for authentication methods '%s'", \ optname, validmethods), \ errcontext("line %d of configuration file \"%s\"", \ line_num, HbaFileName))); \ --- 578,584 ---- #define INVALID_AUTH_OPTION(optname, validmethods) do {\ ereport(LOG, \ (errcode(ERRCODE_CONFIG_FILE_ERROR), \ ! errmsg("authentication option \"%s\" is only valid for authentication methods \"%s\"", \ optname, validmethods), \ errcontext("line %d of configuration file \"%s\"", \ line_num, HbaFileName))); \ *************** check_db(const char *dbname, const char *** 594,600 **** if (argvar == NULL) {\ ereport(LOG, \ (errcode(ERRCODE_CONFIG_FILE_ERROR), \ ! errmsg("authentication method '%s' requires argument '%s' to be set", \ authname, argname), \ errcontext("line %d of configuration file \"%s\"", \ line_num, HbaFileName))); \ --- 594,600 ---- if (argvar == NULL) {\ ereport(LOG, \ (errcode(ERRCODE_CONFIG_FILE_ERROR), \ ! errmsg("authentication method \"%s\" requires argument \"%s\" to be set", \ authname, argname), \ errcontext("line %d of configuration file \"%s\"", \ line_num, HbaFileName))); \ *************** parse_hba_line(List *line, int line_num, *** 1024,1030 **** { ereport(LOG, (errcode(ERRCODE_CONFIG_FILE_ERROR), ! errmsg("invalid ldap port '%s'", c), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); return false; --- 1024,1030 ---- { ereport(LOG, (errcode(ERRCODE_CONFIG_FILE_ERROR), ! errmsg("invalid LDAP port number: \"%s\"", c), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); return false; *************** parse_hba_line(List *line, int line_num, *** 1068,1074 **** { ereport(LOG, (errcode(ERRCODE_CONFIG_FILE_ERROR), ! errmsg("unknown authentication option name '%s'", token), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); return false; --- 1068,1074 ---- { ereport(LOG, (errcode(ERRCODE_CONFIG_FILE_ERROR), ! errmsg("unknown authentication option name: \"%s\"", token), errcontext("line %d of configuration file \"%s\"", line_num, HbaFileName))); return false; *************** parse_ident_usermap(List *line, int line *** 1488,1494 **** pg_regerror(r, &re, errstr, sizeof(errstr)); ereport(ERROR, (errcode(ERRCODE_INVALID_REGULAR_EXPRESSION), ! errmsg("invalid regular expression '%s': %s", file_ident_user+1, errstr))); pfree(wstr); *error_p = true; --- 1488,1494 ---- pg_regerror(r, &re, errstr, sizeof(errstr)); ereport(ERROR, (errcode(ERRCODE_INVALID_REGULAR_EXPRESSION), ! errmsg("invalid regular expression \"%s\": %s", file_ident_user+1, errstr))); pfree(wstr); *error_p = true; *************** parse_ident_usermap(List *line, int line *** 1510,1516 **** pg_regerror(r, &re, errstr, sizeof(errstr)); ereport(ERROR, (errcode(ERRCODE_INVALID_REGULAR_EXPRESSION), ! errmsg("regular expression match for '%s' failed: %s", file_ident_user+1, errstr))); *error_p = true; } --- 1510,1516 ---- pg_regerror(r, &re, errstr, sizeof(errstr)); ereport(ERROR, (errcode(ERRCODE_INVALID_REGULAR_EXPRESSION), ! errmsg("regular expression match for \"%s\" failed: %s", file_ident_user+1, errstr))); *error_p = true; } *************** parse_ident_usermap(List *line, int line *** 1526,1532 **** if (matches[1].rm_so < 0) ereport(ERROR, (errcode(ERRCODE_INVALID_REGULAR_EXPRESSION), ! errmsg("regular expression '%s' has no subexpressions as requested by backreference in '%s'", file_ident_user+1, file_pgrole))); /* length: original length minus length of \1 plus length of match plus null terminator */ regexp_pgrole = palloc0(strlen(file_pgrole) - 2 + (matches[1].rm_eo-matches[1].rm_so) + 1); --- 1526,1532 ---- if (matches[1].rm_so < 0) ereport(ERROR, (errcode(ERRCODE_INVALID_REGULAR_EXPRESSION), ! errmsg("regular expression \"%s\" has no subexpressions as requested by backreference in \"%s\"", file_ident_user+1, file_pgrole))); /* length: original length minus length of \1 plus length of match plus null terminator */ regexp_pgrole = palloc0(strlen(file_pgrole) - 2 + (matches[1].rm_eo-matches[1].rm_so) + 1); *************** check_usermap(const char *usermap_name, *** 1642,1650 **** if (!found_entry && !error) { ereport(LOG, ! (errmsg("no match in usermap for user '%s' authenticated as '%s'", pg_role, auth_user), ! errcontext("usermap '%s'", usermap_name))); } return found_entry?STATUS_OK:STATUS_ERROR; } --- 1642,1650 ---- if (!found_entry && !error) { ereport(LOG, ! (errmsg("no match in usermap for user \"%s\" authenticated as \"%s\"", pg_role, auth_user), ! errcontext("usermap \"%s\"", usermap_name))); } return found_entry?STATUS_OK:STATUS_ERROR; }