diff options
| author | michen <none@none> | 2007-08-27 16:34:51 -0700 |
|---|---|---|
| committer | michen <none@none> | 2007-08-27 16:34:51 -0700 |
| commit | 3d0479833b8db89da4bca3e8e8e88f996686aa8e (patch) | |
| tree | dc478f789f8f95dcc58daf6a9f5547bd2b57baa0 /usr/src/lib/libsldap/common/ns_reads.c | |
| parent | 408473482bbd28b3bb2ca89af2baefc8264ba19f (diff) | |
| download | illumos-joyent-3d0479833b8db89da4bca3e8e8e88f996686aa8e.tar.gz | |
6514060 nscd consumes all the memory that it can
6591680 users failed to log in at the first attempt but could log in at the second attempt
Diffstat (limited to 'usr/src/lib/libsldap/common/ns_reads.c')
| -rw-r--r-- | usr/src/lib/libsldap/common/ns_reads.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/usr/src/lib/libsldap/common/ns_reads.c b/usr/src/lib/libsldap/common/ns_reads.c index 284704ca61..8acde7cd5a 100644 --- a/usr/src/lib/libsldap/common/ns_reads.c +++ b/usr/src/lib/libsldap/common/ns_reads.c @@ -1624,8 +1624,10 @@ get_next_session(ns_ldap_cookie_t *cookie) int rc; int fail_if_new_pwd_reqd = 1; - if (cookie->connectionId > -1) + if (cookie->connectionId > -1) { DropConnection(cookie->connectionId, cookie->i_flags); + cookie->connectionId = -1; + } rc = __s_api_getConnection(NULL, cookie->i_flags, cookie->i_auth, &connectionId, &conp, @@ -1663,8 +1665,10 @@ get_referral_session(ns_ldap_cookie_t *cookie) int rc; int fail_if_new_pwd_reqd = 1; - if (cookie->connectionId > -1) + if (cookie->connectionId > -1) { DropConnection(cookie->connectionId, cookie->i_flags); + cookie->connectionId = -1; + } rc = __s_api_getConnection(cookie->refpos->refHost, 0, cookie->i_auth, &connectionId, &conp, @@ -2066,15 +2070,18 @@ search_state_machine(ns_ldap_cookie_t *cookie, ns_state_t state, int cycle) ns_ldap_error_t **errorp; errorp = &error; - cookie->err_rc = 0; cookie->state = state; errstr[0] = '\0'; for (;;) { switch (cookie->state) { case CLEAR_RESULTS: - (void) ldap_abandon_ext(cookie->conn->ld, - cookie->msgId, NULL, NULL); + if (cookie->conn != NULL && cookie->conn->ld != NULL && + cookie->connectionId != -1 && cookie->msgId != 0) { + (void) ldap_abandon_ext(cookie->conn->ld, + cookie->msgId, NULL, NULL); + cookie->msgId = 0; + } cookie->new_state = EXIT; break; case GET_ACCT_MGMT_INFO: @@ -2967,8 +2974,12 @@ __ns_ldap_firstEntry( cookie->result = NULL; *vcookie = (void *)cookie; return (NS_LDAP_SUCCESS); - case ERROR: case LDAP_ERROR: + state = search_state_machine(cookie, state, ONE_STEP); + state = search_state_machine(cookie, CLEAR_RESULTS, + ONE_STEP); + /* FALLTHROUGH */ + case ERROR: rc = cookie->err_rc; *errorp = cookie->errorp; cookie->errorp = NULL; @@ -3026,8 +3037,12 @@ __ns_ldap_nextEntry( *result = cookie->result; cookie->result = NULL; return (NS_LDAP_SUCCESS); - case ERROR: case LDAP_ERROR: + state = search_state_machine(cookie, state, ONE_STEP); + state = search_state_machine(cookie, CLEAR_RESULTS, + ONE_STEP); + /* FALLTHROUGH */ + case ERROR: rc = cookie->err_rc; *errorp = cookie->errorp; cookie->errorp = NULL; |
