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
edc9109c
Commit
edc9109c
authored
Sep 27, 2012
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Produce textual error messages for LDAP issues instead of numeric codes
parent
70bc5833
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
src/backend/libpq/auth.c
src/backend/libpq/auth.c
+9
-10
No files found.
src/backend/libpq/auth.c
View file @
edc9109c
...
@@ -2037,8 +2037,7 @@ InitializeLDAPConnection(Port *port, LDAP **ldap)
...
@@ -2037,8 +2037,7 @@ InitializeLDAPConnection(Port *port, LDAP **ldap)
{
{
#ifndef WIN32
#ifndef WIN32
ereport
(
LOG
,
ereport
(
LOG
,
(
errmsg
(
"could not initialize LDAP: error code %d"
,
(
errmsg
(
"could not initialize LDAP: %m"
)));
errno
)));
#else
#else
ereport
(
LOG
,
ereport
(
LOG
,
(
errmsg
(
"could not initialize LDAP: error code %d"
,
(
errmsg
(
"could not initialize LDAP: error code %d"
,
...
@@ -2051,7 +2050,7 @@ InitializeLDAPConnection(Port *port, LDAP **ldap)
...
@@ -2051,7 +2050,7 @@ InitializeLDAPConnection(Port *port, LDAP **ldap)
{
{
ldap_unbind
(
*
ldap
);
ldap_unbind
(
*
ldap
);
ereport
(
LOG
,
ereport
(
LOG
,
(
errmsg
(
"could not set LDAP protocol version:
error code %d"
,
r
)));
(
errmsg
(
"could not set LDAP protocol version:
%s"
,
ldap_err2string
(
r
)
)));
return
STATUS_ERROR
;
return
STATUS_ERROR
;
}
}
...
@@ -2104,7 +2103,7 @@ InitializeLDAPConnection(Port *port, LDAP **ldap)
...
@@ -2104,7 +2103,7 @@ InitializeLDAPConnection(Port *port, LDAP **ldap)
{
{
ldap_unbind
(
*
ldap
);
ldap_unbind
(
*
ldap
);
ereport
(
LOG
,
ereport
(
LOG
,
(
errmsg
(
"could not start LDAP TLS session:
error code %d"
,
r
)));
(
errmsg
(
"could not start LDAP TLS session:
%s"
,
ldap_err2string
(
r
)
)));
return
STATUS_ERROR
;
return
STATUS_ERROR
;
}
}
}
}
...
@@ -2193,8 +2192,8 @@ CheckLDAPAuth(Port *port)
...
@@ -2193,8 +2192,8 @@ CheckLDAPAuth(Port *port)
if
(
r
!=
LDAP_SUCCESS
)
if
(
r
!=
LDAP_SUCCESS
)
{
{
ereport
(
LOG
,
ereport
(
LOG
,
(
errmsg
(
"could not perform initial LDAP bind for ldapbinddn
\"
%s
\"
on server
\"
%s
\"
:
error code %d
"
,
(
errmsg
(
"could not perform initial LDAP bind for ldapbinddn
\"
%s
\"
on server
\"
%s
\"
:
%s
"
,
port
->
hba
->
ldapbinddn
,
port
->
hba
->
ldapserver
,
r
)));
port
->
hba
->
ldapbinddn
,
port
->
hba
->
ldapserver
,
ldap_err2string
(
r
)
)));
return
STATUS_ERROR
;
return
STATUS_ERROR
;
}
}
...
@@ -2218,8 +2217,8 @@ CheckLDAPAuth(Port *port)
...
@@ -2218,8 +2217,8 @@ CheckLDAPAuth(Port *port)
if
(
r
!=
LDAP_SUCCESS
)
if
(
r
!=
LDAP_SUCCESS
)
{
{
ereport
(
LOG
,
ereport
(
LOG
,
(
errmsg
(
"could not search LDAP for filter
\"
%s
\"
on server
\"
%s
\"
:
error code %d
"
,
(
errmsg
(
"could not search LDAP for filter
\"
%s
\"
on server
\"
%s
\"
:
%s
"
,
filter
,
port
->
hba
->
ldapserver
,
r
)));
filter
,
port
->
hba
->
ldapserver
,
ldap_err2string
(
r
)
)));
pfree
(
filter
);
pfree
(
filter
);
return
STATUS_ERROR
;
return
STATUS_ERROR
;
}
}
...
@@ -2306,8 +2305,8 @@ CheckLDAPAuth(Port *port)
...
@@ -2306,8 +2305,8 @@ CheckLDAPAuth(Port *port)
if
(
r
!=
LDAP_SUCCESS
)
if
(
r
!=
LDAP_SUCCESS
)
{
{
ereport
(
LOG
,
ereport
(
LOG
,
(
errmsg
(
"LDAP login failed for user
\"
%s
\"
on server
\"
%s
\"
:
error code %d
"
,
(
errmsg
(
"LDAP login failed for user
\"
%s
\"
on server
\"
%s
\"
:
%s
"
,
fulluser
,
port
->
hba
->
ldapserver
,
r
)));
fulluser
,
port
->
hba
->
ldapserver
,
ldap_err2string
(
r
)
)));
pfree
(
fulluser
);
pfree
(
fulluser
);
return
STATUS_ERROR
;
return
STATUS_ERROR
;
}
}
...
...
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