Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
448950b3
Commit
448950b3
authored
16 years ago
by
Magnus Hagander
Browse files
Options
Downloads
Patches
Plain Diff
Fix error messages from recent pg_hba parsing patch to use errcontext()
to indicate where the error occurred.
parent
4adc2f72
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/backend/libpq/hba.c
+18
-16
18 additions, 16 deletions
src/backend/libpq/hba.c
with
18 additions
and
16 deletions
src/backend/libpq/hba.c
+
18
−
16
View file @
448950b3
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.16
7
2008/09/15
12:32:56
mha Exp $
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.16
8
2008/09/15
20:55:04
mha Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -660,8 +660,8 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
...
@@ -660,8 +660,8 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
(
errcode
(
ERRCODE_CONFIG_FILE_ERROR
),
(
errcode
(
ERRCODE_CONFIG_FILE_ERROR
),
errmsg
(
"invalid IP address
\"
%s
\"
: %s"
,
errmsg
(
"invalid IP address
\"
%s
\"
: %s"
,
token
,
gai_strerror
(
ret
)),
token
,
gai_strerror
(
ret
)),
err
detail
(
"I
n file
\"
%s
\"
, line %d
"
,
err
context
(
"line %d of configuratio
n file
\"
%s
\"
"
,
HbaFileName
,
line_num
)));
line_num
,
HbaFileName
)));
if
(
cidr_slash
)
if
(
cidr_slash
)
*
cidr_slash
=
'/'
;
*
cidr_slash
=
'/'
;
if
(
gai_result
)
if
(
gai_result
)
...
@@ -697,8 +697,8 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
...
@@ -697,8 +697,8 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
(
errcode
(
ERRCODE_CONFIG_FILE_ERROR
),
(
errcode
(
ERRCODE_CONFIG_FILE_ERROR
),
errmsg
(
"invalid IP mask
\"
%s
\"
: %s"
,
errmsg
(
"invalid IP mask
\"
%s
\"
: %s"
,
token
,
gai_strerror
(
ret
)),
token
,
gai_strerror
(
ret
)),
err
detail
(
"I
n file
\"
%s
\"
, line %d
"
,
err
context
(
"line %d of configuratio
n file
\"
%s
\"
"
,
HbaFileName
,
line_num
)));
line_num
,
HbaFileName
)));
if
(
gai_result
)
if
(
gai_result
)
pg_freeaddrinfo_all
(
hints
.
ai_family
,
gai_result
);
pg_freeaddrinfo_all
(
hints
.
ai_family
,
gai_result
);
goto
hba_other_error
;
goto
hba_other_error
;
...
@@ -773,8 +773,8 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
...
@@ -773,8 +773,8 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
(
errcode
(
ERRCODE_CONFIG_FILE_ERROR
),
(
errcode
(
ERRCODE_CONFIG_FILE_ERROR
),
errmsg
(
"invalid authentication method
\"
%s
\"
"
,
errmsg
(
"invalid authentication method
\"
%s
\"
"
,
token
),
token
),
err
detail
(
"I
n file
\"
%s
\"
line %d
"
,
err
context
(
"line %d of configuratio
n file
\"
%s
\"
"
,
HbaFileName
,
line_num
)));
line_num
,
HbaFileName
)));
goto
hba_other_error
;
goto
hba_other_error
;
}
}
...
@@ -784,8 +784,8 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
...
@@ -784,8 +784,8 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
(
errcode
(
ERRCODE_CONFIG_FILE_ERROR
),
(
errcode
(
ERRCODE_CONFIG_FILE_ERROR
),
errmsg
(
"invalid authentication method
\"
%s
\"
: not supported on this platform"
,
errmsg
(
"invalid authentication method
\"
%s
\"
: not supported on this platform"
,
token
),
token
),
err
detail
(
"I
n file
\"
%s
\"
line %d
"
,
err
context
(
"line %d of configuratio
n file
\"
%s
\"
"
,
HbaFileName
,
line_num
)));
line_num
,
HbaFileName
)));
goto
hba_other_error
;
goto
hba_other_error
;
}
}
...
@@ -796,8 +796,8 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
...
@@ -796,8 +796,8 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline)
ereport
(
LOG
,
ereport
(
LOG
,
(
errcode
(
ERRCODE_CONFIG_FILE_ERROR
),
(
errcode
(
ERRCODE_CONFIG_FILE_ERROR
),
errmsg
(
"krb5 authentication is not supported on local sockets"
),
errmsg
(
"krb5 authentication is not supported on local sockets"
),
err
detail
(
"I
n file
\"
%s
\"
line %d
"
,
err
context
(
"line %d of configuratio
n file
\"
%s
\"
"
,
HbaFileName
,
line_num
)));
line_num
,
HbaFileName
)));
goto
hba_other_error
;
goto
hba_other_error
;
}
}
...
@@ -840,14 +840,16 @@ hba_syntax:
...
@@ -840,14 +840,16 @@ hba_syntax:
if
(
line_item
)
if
(
line_item
)
ereport
(
LOG
,
ereport
(
LOG
,
(
errcode
(
ERRCODE_CONFIG_FILE_ERROR
),
(
errcode
(
ERRCODE_CONFIG_FILE_ERROR
),
errmsg
(
"invalid entry in file
\"
%s
\"
at line %d, token
\"
%s
\"
"
,
errmsg
(
"invalid token
\"
%s
\"
"
,
HbaFileName
,
line_num
,
(
char
*
)
lfirst
(
line_item
)),
(
char
*
)
lfirst
(
line_item
))));
errcontext
(
"line %d of configuration file
\"
%s
\"
"
,
line_num
,
HbaFileName
)));
else
else
ereport
(
LOG
,
ereport
(
LOG
,
(
errcode
(
ERRCODE_CONFIG_FILE_ERROR
),
(
errcode
(
ERRCODE_CONFIG_FILE_ERROR
),
errmsg
(
"missing field in file
\"
%s
\"
at end of line %d"
,
errmsg
(
"missing field at end of line"
),
HbaFileName
,
line_num
)));
errcontext
(
"line %d of configuration file
\"
%s
\"
"
,
line_num
,
HbaFileName
)));
/* Come here if suitable message already logged */
/* Come here if suitable message already logged */
hba_other_error:
hba_other_error:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment