From 7600b22f3c0ba09dedc6f2e24ee2447871c8b127 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 16 Oct 2010 12:14:49 +0000 Subject: [PATCH] ITS#6676 only close/unlink socket in Server mode --- contrib/slapd-modules/nssov/nssov.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/contrib/slapd-modules/nssov/nssov.c b/contrib/slapd-modules/nssov/nssov.c index 84e05b2e6f..fa05479270 100644 --- a/contrib/slapd-modules/nssov/nssov.c +++ b/contrib/slapd-modules/nssov/nssov.c @@ -881,18 +881,20 @@ nssov_db_close( slap_overinst *on = (slap_overinst *)be->bd_info; nssov_info *ni = on->on_bi.bi_private; - /* close socket if it's still in use */ - if (ni->ni_socket >= 0); - { - if (close(ni->ni_socket)) - Debug( LDAP_DEBUG_ANY,"problem closing server socket (ignored): %s",strerror(errno),0,0); - ni->ni_socket = -1; - } - /* remove existing named socket */ - if (unlink(NSLCD_SOCKET)<0) - { - Debug( LDAP_DEBUG_TRACE,"unlink() of "NSLCD_SOCKET" failed (ignored): %s", - strerror(errno),0,0); + if ( slapMode & SLAP_SERVER_MODE ) { + /* close socket if it's still in use */ + if (ni->ni_socket >= 0); + { + if (close(ni->ni_socket)) + Debug( LDAP_DEBUG_ANY,"problem closing server socket (ignored): %s",strerror(errno),0,0); + ni->ni_socket = -1; + } + /* remove existing named socket */ + if (unlink(NSLCD_SOCKET)<0) + { + Debug( LDAP_DEBUG_TRACE,"unlink() of "NSLCD_SOCKET" failed (ignored): %s", + strerror(errno),0,0); + } } } -- 2.39.5