diff options
author | mj162486 <none@none> | 2007-11-28 02:54:41 -0800 |
---|---|---|
committer | mj162486 <none@none> | 2007-11-28 02:54:41 -0800 |
commit | ff7f623f01a92dc7bd7ee78a0cbf1b6a671d076a (patch) | |
tree | 2409c59b7a1239f7bea5f4e7cefcc77ef7d91634 /usr/src/lib/libsldap/common/ns_connect.c | |
parent | a57eccd31b96eb36e352c7b9dfbde13b30eae16c (diff) | |
download | illumos-gate-ff7f623f01a92dc7bd7ee78a0cbf1b6a671d076a.tar.gz |
6617663 For non-nscd processes, libsldap should not automatically keep connections open
Diffstat (limited to 'usr/src/lib/libsldap/common/ns_connect.c')
-rw-r--r-- | usr/src/lib/libsldap/common/ns_connect.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/usr/src/lib/libsldap/common/ns_connect.c b/usr/src/lib/libsldap/common/ns_connect.c index 8a27a77144..4f574f85e4 100644 --- a/usr/src/lib/libsldap/common/ns_connect.c +++ b/usr/src/lib/libsldap/common/ns_connect.c @@ -803,8 +803,13 @@ findConnectionById(int flags, const ns_cred_t *auth, ConnectionID cID, if ((conp == NULL) || (auth == NULL) || cID < CONID_OFFSET) return (-1); - /* if a new connection is requested, no need to continue */ - if (flags & NS_LDAP_NEW_CONN) + /* + * If a new connection is requested, no need to continue. + * If the process is not nscd and is not requesting keep connections + * alive, no need to continue. + */ + if ((flags & NS_LDAP_NEW_CONN) || (!__s_api_nscd_proc() && + !(flags & NS_LDAP_KEEP_CONN))) return (-1); *conp = NULL; @@ -1630,9 +1635,7 @@ _DropConnection(ConnectionID cID, int flag, int fini) if (!fini && ((flag & NS_LDAP_NEW_CONN) == 0) && !cp->notAvail && - ((flag & NS_LDAP_KEEP_CONN) || - (MTperConn == 0 && __s_api_nscd_proc()) || - MTperConn)) { + ((flag & NS_LDAP_KEEP_CONN) || __s_api_nscd_proc())) { #ifdef DEBUG (void) fprintf(stderr, "tid= %d: keep alive (fini = %d " "shared = %d)\n", t, fini, cp->shared); |