Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
cfac7022
Commit
cfac7022
authored
Apr 19, 2010
by
Simon Riggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new message for explicit rejection by pg_hba.conf. Implicit
rejection retains same message as before.
parent
7bc76d51
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
10 deletions
+42
-10
src/backend/libpq/auth.c
src/backend/libpq/auth.c
+37
-6
src/backend/libpq/hba.c
src/backend/libpq/hba.c
+3
-3
src/include/libpq/hba.h
src/include/libpq/hba.h
+2
-1
No files found.
src/backend/libpq/auth.c
View file @
cfac7022
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.19
8 2010/03/30 16:08:22 petere
Exp $
* $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.19
9 2010/04/19 19:02: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.
*/
...
...
src/backend/libpq/hba.c
View file @
cfac7022
...
...
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.20
4 2010/03/24 17:05:45 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.20
5 2010/04/19 19:02: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
;
...
...
src/include/libpq/hba.h
View file @
cfac7022
...
...
@@ -4,7 +4,7 @@
* Interface to hba.c
*
*
* $PostgreSQL: pgsql/src/include/libpq/hba.h,v 1.6
1 2010/01/27 12:12:00 mha
Exp $
* $PostgreSQL: pgsql/src/include/libpq/hba.h,v 1.6
2 2010/04/19 19:02:18 sriggs
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -18,6 +18,7 @@
typedef
enum
UserAuth
{
uaReject
,
uaImplicitReject
,
uaKrb5
,
uaTrust
,
uaIdent
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment