Commit 22fd5a89 authored by Howard Chu's avatar Howard Chu
Browse files

ITS#9477 fix regression from #9339

Must provide plain IP address for TCP wrapper
parent 146889f2
...@@ -2097,7 +2097,6 @@ slap_listener( ...@@ -2097,7 +2097,6 @@ slap_listener(
#endif /* SLAPD_RLOOKUPS */ #endif /* SLAPD_RLOOKUPS */
char *dnsname = NULL; char *dnsname = NULL;
const char *peeraddr = NULL;
/* we assume INET6_ADDRSTRLEN > INET_ADDRSTRLEN */ /* we assume INET6_ADDRSTRLEN > INET_ADDRSTRLEN */
char peername[LUTIL_ADDRLEN]; char peername[LUTIL_ADDRLEN];
struct berval peerbv = BER_BVC(peername); struct berval peerbv = BER_BVC(peername);
...@@ -2308,6 +2307,11 @@ slap_listener( ...@@ -2308,6 +2307,11 @@ slap_listener(
#ifdef HAVE_TCPD #ifdef HAVE_TCPD
{ {
int rc; int rc;
char *peeraddr, *paend;
peeraddr = peerbv.bv_val + 3;
paend = strrchr( peeraddr, ':' );
if ( paend )
*paend = '\0';
ldap_pvt_thread_mutex_lock( &sd_tcpd_mutex ); ldap_pvt_thread_mutex_lock( &sd_tcpd_mutex );
rc = hosts_ctl("slapd", rc = hosts_ctl("slapd",
dnsname != NULL ? dnsname : SLAP_STRING_UNKNOWN, dnsname != NULL ? dnsname : SLAP_STRING_UNKNOWN,
...@@ -2324,6 +2328,8 @@ slap_listener( ...@@ -2324,6 +2328,8 @@ slap_listener(
slapd_close(sfd); slapd_close(sfd);
return 0; return 0;
} }
if ( paend )
*paend = ':';
} }
#endif /* HAVE_TCPD */ #endif /* HAVE_TCPD */
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment