Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
f2ae471a
Commit
f2ae471a
authored
May 07, 2013
by
Sumit Bose
Committed by
Quanah Gibson-Mount
Apr 18, 2019
Browse files
ITS#7585 fix ldapi with SASL_NOCANON
Was using the ldapi socket path as a hostname
parent
09eb8024
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/libldap/cyrus.c
View file @
f2ae471a
...
...
@@ -385,6 +385,8 @@ ldap_int_sasl_bind(
struct
berval
ccred
=
BER_BVNULL
;
int
saslrc
,
rc
;
unsigned
credlen
;
char
my_hostname
[
HOST_NAME_MAX
+
1
];
int
free_saslhost
=
0
;
Debug
(
LDAP_DEBUG_TRACE
,
"ldap_int_sasl_bind: %s
\n
"
,
mechs
?
mechs
:
"<null>"
,
0
,
0
);
...
...
@@ -445,14 +447,25 @@ ldap_int_sasl_bind(
/* If we don't need to canonicalize just use the host
* from the LDAP URI.
* Always use the result of gethostname() for LDAPI.
*/
if
(
nocanon
)
if
(
ld
->
ld_defconn
->
lconn_server
->
lud_scheme
!=
NULL
&&
strcmp
(
"ldapi"
,
ld
->
ld_defconn
->
lconn_server
->
lud_scheme
)
==
0
)
{
rc
=
gethostname
(
my_hostname
,
HOST_NAME_MAX
+
1
);
if
(
rc
==
0
)
{
saslhost
=
my_hostname
;
}
else
{
saslhost
=
"localhost"
;
}
}
else
if
(
nocanon
)
saslhost
=
ld
->
ld_defconn
->
lconn_server
->
lud_host
;
else
else
{
saslhost
=
ldap_host_connected_to
(
ld
->
ld_defconn
->
lconn_sb
,
"localhost"
);
free_saslhost
=
1
;
}
rc
=
ldap_int_sasl_open
(
ld
,
ld
->
ld_defconn
,
saslhost
);
if
(
!
nocanon
)
if
(
free_saslhost
)
LDAP_FREE
(
saslhost
);
}
...
...
Write
Preview
Supports
Markdown
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