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
cfac7022
Commit
cfac7022
authored
15 years ago
by
Simon Riggs
Browse files
Options
Downloads
Patches
Plain Diff
Add new message for explicit rejection by pg_hba.conf. Implicit
rejection retains same message as before.
parent
7bc76d51
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/backend/libpq/auth.c
+37
-6
37 additions, 6 deletions
src/backend/libpq/auth.c
src/backend/libpq/hba.c
+3
-3
3 additions, 3 deletions
src/backend/libpq/hba.c
src/include/libpq/hba.h
+2
-1
2 additions, 1 deletion
src/include/libpq/hba.h
with
42 additions
and
10 deletions
src/backend/libpq/auth.c
+
37
−
6
View file @
cfac7022
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.19
8
2010/0
3/30
1
6
:0
8:22 petere
Exp $
* $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.19
9
2010/0
4/19
1
9
:0
2:18 sriggs
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -363,11 +363,42 @@ ClientAuthentication(Port *port)
case
uaReject
:
/*
* This could have come from an explicit "reject" entry in
* pg_hba.conf, but more likely it means there was no matching
* entry. Take pity on the poor user and issue a helpful error
* message. NOTE: this is not a security breach, because all the
* info reported here is known at the frontend and must be assumed
* An explicit "reject" entry in pg_hba.conf. Take pity on the poor
* user and issue a helpful error message.
* NOTE: this is not a security breach, because all the info
* reported here is known at the frontend and must be assumed
* known to bad guys. We're merely helping out the less clueful
* good guys.
*/
{
char
hostinfo
[
NI_MAXHOST
];
pg_getnameinfo_all
(
&
port
->
raddr
.
addr
,
port
->
raddr
.
salen
,
hostinfo
,
sizeof
(
hostinfo
),
NULL
,
0
,
NI_NUMERICHOST
);
#ifdef USE_SSL
ereport
(
FATAL
,
(
errcode
(
ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION
),
errmsg
(
"pg_hba.conf rejects host
\"
%s
\"
, user
\"
%s
\"
, database
\"
%s
\"
, %s"
,
hostinfo
,
port
->
user_name
,
port
->
database_name
,
port
->
ssl
?
_
(
"SSL on"
)
:
_
(
"SSL off"
))));
#else
ereport
(
FATAL
,
(
errcode
(
ERRCODE_INVALID_AUTHORIZATION_SPECIFICATION
),
errmsg
(
"pg_hba.conf rejects host
\"
%s
\"
, user
\"
%s
\"
, database
\"
%s
\"
"
,
hostinfo
,
port
->
user_name
,
port
->
database_name
)));
#endif
break
;
}
case
uaImplicitReject
:
/*
* No matching entry so tell the user we fell through.
* NOTE: this is not a security breach, because all the info
* reported here is known at the frontend and must be assumed
* known to bad guys. We're merely helping out the less clueful
* good guys.
*/
...
...
This diff is collapsed.
Click to expand it.
src/backend/libpq/hba.c
+
3
−
3
View file @
cfac7022
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.20
4
2010/0
3/24
1
7
:0
5:45 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.20
5
2010/0
4/19
1
9
:0
2:18 sriggs
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1389,9 +1389,9 @@ check_hba(hbaPort *port)
return
true
;
}
/* If no matching entry was found,
synthesize 'reject' entry
. */
/* If no matching entry was found,
then implicitly reject
. */
hba
=
palloc0
(
sizeof
(
HbaLine
));
hba
->
auth_method
=
uaReject
;
hba
->
auth_method
=
ua
Implicit
Reject
;
port
->
hba
=
hba
;
return
true
;
...
...
This diff is collapsed.
Click to expand it.
src/include/libpq/hba.h
+
2
−
1
View file @
cfac7022
...
...
@@ -4,7 +4,7 @@
* Interface to hba.c
*
*
* $PostgreSQL: pgsql/src/include/libpq/hba.h,v 1.6
1
2010/0
1/27 12:12:00 mha
Exp $
* $PostgreSQL: pgsql/src/include/libpq/hba.h,v 1.6
2
2010/0
4/19 19:02:18 sriggs
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -18,6 +18,7 @@
typedef
enum
UserAuth
{
uaReject
,
uaImplicitReject
,
uaKrb5
,
uaTrust
,
uaIdent
,
...
...
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