summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2008-05-16 20:39:11 +0000
committerNoriko Hosoi <nhosoi@redhat.com>2008-05-16 20:39:11 +0000
commit30a69b90a2cbb45b0864c10e039ad479311d04cd (patch)
tree25fabc07cbf542c2afc9dde82e1a7335514de52d
parent4a57eca0bf1a98153e8cdef1ea18b30fd80720b7 (diff)
downloadds-30a69b90a2cbb45b0864c10e039ad479311d04cd.tar.gz
ds-30a69b90a2cbb45b0864c10e039ad479311d04cd.tar.xz
ds-30a69b90a2cbb45b0864c10e039ad479311d04cd.zip
Resolves: #436390
Summary: LDAPI: support auto-bind Description: String representation of socktype was not set correctly when the socktype was PR_AF_LOCAL.
-rw-r--r--ldap/servers/slapd/daemon.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c
index 71531b51..7bf89491 100644
--- a/ldap/servers/slapd/daemon.c
+++ b/ldap/servers/slapd/daemon.c
@@ -2741,7 +2741,7 @@ createprlistensockets(PRUint16 port, PRNetAddr **listenaddr,
char *logname = "createprlistensockets";
int sockcnt = 0;
int socktype;
- char *socktype_s = NULL;
+ char *socktype_str = NULL;
PRNetAddr **lap;
int i;
@@ -2749,13 +2749,6 @@ createprlistensockets(PRUint16 port, PRNetAddr **listenaddr,
PR_ASSERT( listenaddr != NULL );
-#if defined(ENABLE_LDAPI)
- if(local) { /* ldapi */
- socktype = PR_AF_LOCAL;
- socktype_s = "PR_AF_LOCAL";
- }
-#endif
-
/* need to know the count */
sockcnt = 0;
for (lap = listenaddr; lap && *lap; lap++) {
@@ -2773,16 +2766,21 @@ createprlistensockets(PRUint16 port, PRNetAddr **listenaddr,
for (i = 0, lap = listenaddr; lap && *lap && i < sockcnt; i++, lap++) {
/* create TCP socket */
socktype = PR_NetAddrFamily(*lap);
+#if defined(ENABLE_LDAPI)
+ if (PR_AF_LOCAL == socktype) {
+ socktype_str = "PR_AF_LOCAL";
+ } else
+#endif
if (PR_AF_INET6 == socktype) {
- socktype_s = "PR_AF_INET6";
+ socktype_str = "PR_AF_INET6";
} else {
- socktype_s = "PR_AF_INET";
+ socktype_str = "PR_AF_INET";
}
if ((sock[i] = PR_OpenTCPSocket(socktype)) == SLAPD_INVALID_SOCKET) {
prerr = PR_GetError();
slapi_log_error(SLAPI_LOG_FATAL, logname,
"PR_OpenTCPSocket(%s) failed: %s error %d (%s)\n",
- socktype_s,
+ socktype_str,
SLAPI_COMPONENT_NAME_NSPR, prerr, slapd_pr_strerror(prerr));
goto failed;
}