Lines Matching refs:stat
185 int numLocDN, stat = 0, count = 0; in createLdapRequest() local
218 mit_ldap, mit_nisplus, rv, !fromLDAP, &stat); in createLdapRequest()
221 if (stat == NP_LDAP_RULES_NO_VALUE) in createLdapRequest()
223 stat = 0; in createLdapRequest()
444 int stat; in exclusiveLC() local
449 stat = mutex_trylock(&lc->mutex); in exclusiveLC()
450 if (stat == EBUSY && lc->owner != me) in exclusiveLC()
460 int stat; in assertExclusive() local
465 stat = mutex_trylock(&lc->mutex); in assertExclusive()
467 if (stat == 0) { in assertExclusive()
473 if (stat != EBUSY || lc->owner != me) in assertExclusive()
653 int stat; in disconnectCon() local
676 stat = ldap_unbind_s(lc->ld); in disconnectCon()
677 if (stat == LDAP_SUCCESS) { in disconnectCon()
687 myself, stat, ldap_err2string(stat)); in disconnectCon()
695 stat = LDAP_UNAVAILABLE; in disconnectCon()
698 return (stat); in disconnectCon()
717 int stat, i; in controlSupported() local
724 stat = ldap_search_st(lc->ld, "", LDAP_SCOPE_BASE, "(objectclass=*)", in controlSupported()
726 if (stat != LDAP_SUCCESS) { in controlSupported()
729 myself, NIL(lc->sp), ldap_err2string(stat)); in controlSupported()
730 return (stat); in controlSupported()
775 return (stat); in controlSupported()
788 int stat; in connectCon() local
817 stat = disconnectCon(lc); in connectCon()
818 if (stat != LDAP_SUCCESS) in connectCon()
819 return (stat); in connectCon()
841 stat = lc->status = ldapBind(&lc->ld, lc->who, lc->cred, lc->method, in connectCon()
856 return (stat); in connectCon()
863 findCon(int *stat) { in findCon() argument
868 if (stat == 0) in findCon()
869 stat = &ldapStat; in findCon()
876 if ((*stat = setupConList(proxyInfo.default_servers, in findCon()
888 *stat = connectCon(lc, 1); in findCon()
889 if (*stat != LDAP_SUCCESS) { in findCon()
890 if (*stat != LDAP_UNAVAILABLE) { in findCon()
894 ldap_err2string(*stat)); in findCon()
900 *stat = disconnectCon(lc); in findCon()
901 if (*stat != LDAP_UNAVAILABLE) in findCon()
918 int stat; in releaseCon() local
930 stat = disconnectCon(lc); in releaseCon()
932 stat = LDAP_SUCCESS; in releaseCon()
934 if (stat != LDAP_UNAVAILABLE) in releaseCon()
1085 LDAPURLDesc *ludpp, int *stat) in find_connection_from_list() argument
1089 if (stat == 0) in find_connection_from_list()
1090 stat = &ldapStat; in find_connection_from_list()
1092 *stat = LDAP_SUCCESS; in find_connection_from_list()
1098 *stat = connectCon(lc, 1); in find_connection_from_list()
1099 if (*stat != LDAP_SUCCESS) { in find_connection_from_list()
1118 findReferralCon(char **referralsp, int *stat) in findReferralCon() argument
1127 if (stat == 0) in findReferralCon()
1128 stat = &ldapStat; in findReferralCon()
1130 *stat = LDAP_SUCCESS; in findReferralCon()
1164 lc = find_connection_from_list(ldapReferralCon, ludpp, stat); in findReferralCon()
1166 lc = find_connection_from_list(ldapCon, ludpp, stat); in findReferralCon()
1198 *stat = LDAP_NO_MEMORY; in findReferralCon()
1214 lc = find_connection_from_list(ldapReferralCon, ludpp, stat); in findReferralCon()
1234 findYPCon(__nis_ldap_search_t *ls, int *stat) { in findYPCon() argument
1239 if (stat == 0) in findYPCon()
1240 stat = &ldapStat; in findYPCon()
1247 if ((*stat = setupConList(proxyInfo.default_servers, in findYPCon()
1260 *stat = disconnectCon(lc); in findYPCon()
1261 if (*stat != LDAP_UNAVAILABLE) in findYPCon()
1291 ldap_err2string(*stat)); in findYPCon()
1306 *stat = connectCon(lc, 1); in findYPCon()
1307 if (*stat != LDAP_SUCCESS) { in findYPCon()
1308 if (*stat != LDAP_UNAVAILABLE) { in findYPCon()
1312 ldap_err2string(*stat)); in findYPCon()
1349 int stat, numEntries, numVals, tnv, done, lprEc; in ldapSearch() local
1370 ldapStat = &stat; in ldapSearch()
1396 stat = ldap_create_sort_keylist(&sortKeyList, SORTKEYLIST); in ldapSearch()
1397 if (stat != LDAP_SUCCESS) { in ldapSearch()
1400 myself, ldap_err2string(stat)); in ldapSearch()
1402 *ldapStat = stat; in ldapSearch()
1406 stat = ldap_create_sort_control(lc->ld, sortKeyList, 1, in ldapSearch()
1408 if (stat == LDAP_SUCCESS) { in ldapSearch()
1416 ldap_get_option(lc->ld, LDAP_OPT_ERROR_NUMBER, &stat); in ldapSearch()
1419 myself, ldap_err2string(stat)); in ldapSearch()
1421 *ldapStat = stat; in ldapSearch()
1439 *ldapStat = stat; in ldapSearch()
1465 stat = ldap_create_virtuallist_control(lc->ld, in ldapSearch()
1467 if (stat != LDAP_SUCCESS) { in ldapSearch()
1469 &stat); in ldapSearch()
1472 myself, index, ldap_err2string(stat)); in ldapSearch()
1473 *ldapStat = stat; in ldapSearch()
1481 stat = ldap_search_ext_s(lc->ld, ls->base, in ldapSearch()
1489 stat = ldap_create_page_control(lc->ld, in ldapSearch()
1491 if (stat != LDAP_SUCCESS) { in ldapSearch()
1495 &stat); in ldapSearch()
1498 myself, ldap_err2string(stat)); in ldapSearch()
1500 *ldapStat = stat; in ldapSearch()
1505 stat = ldap_search_ext_s(lc->ld, ls->base, in ldapSearch()
1510 stat = ldap_search_st(lc->ld, ls->base, ls->scope, in ldapSearch()
1514 if (stat == LDAP_SUCCESS) in ldapSearch()
1515 ldap_get_option(lc->ld, LDAP_OPT_ERROR_NUMBER, &stat); in ldapSearch()
1517 if (stat == LDAP_SERVER_DOWN) { in ldapSearch()
1519 releaseCon(lc, stat); in ldapSearch()
1530 if (stat == LDAP_REFERRAL && follow_referral) { in ldapSearch()
1536 releaseCon(lc, stat); in ldapSearch()
1537 lc = findReferralCon(referralsp, &stat); in ldapSearch()
1542 *ldapStat = stat; in ldapSearch()
1545 stat = LDAP_SUCCESS; in ldapSearch()
1549 *ldapStat = stat; in ldapSearch()
1586 *ldapStat, ldap_err2string(stat)); in ldapSearch()
1681 stat = ldap_parse_result(lc->ld, msg, &lprEc, 0, 0, 0, in ldapSearch()
1683 if (stat != LDAP_SUCCESS) { in ldapSearch()
1685 &stat); in ldapSearch()
1688 myself, ldap_err2string(stat)); in ldapSearch()
1689 *ldapStat = stat; in ldapSearch()
1698 stat = ldap_parse_virtuallist_control(lc->ld, in ldapSearch()
1701 if (stat == LDAP_SUCCESS) { in ldapSearch()
1712 stat = ldap_parse_result(lc->ld, msg, &lprEc, 0, 0, 0, in ldapSearch()
1714 if (stat != LDAP_SUCCESS) { in ldapSearch()
1716 &stat); in ldapSearch()
1719 myself, ldap_err2string(stat)); in ldapSearch()
1720 *ldapStat = stat; in ldapSearch()
1732 stat = ldap_parse_page_control(lc->ld, in ldapSearch()
1734 if (stat == LDAP_SUCCESS) { in ldapSearch()
1794 releaseCon(lc, stat); in ldapSearch()
1798 releaseCon(lc, stat); in ldapSearch()
2050 int stat; in ldapModifyObjectClass() local
2066 stat = LDAP_OPERATIONS_ERROR; in ldapModifyObjectClass()
2148 stat = LDAP_OPERATIONS_ERROR; in ldapModifyObjectClass()
2157 stat = ldap_result((*lc)->ld, msgid, 0, &tv, &msg); in ldapModifyObjectClass()
2158 if (stat == 0) { in ldapModifyObjectClass()
2159 stat = LDAP_TIMEOUT; in ldapModifyObjectClass()
2160 } else if (stat == -1) { in ldapModifyObjectClass()
2162 LDAP_OPT_ERROR_NUMBER, &stat); in ldapModifyObjectClass()
2164 stat = ldap_parse_result((*lc)->ld, msg, &lderr, NULL, in ldapModifyObjectClass()
2166 if (stat == LDAP_SUCCESS) in ldapModifyObjectClass()
2167 stat = lderr; in ldapModifyObjectClass()
2168 stat = ldap_result2error((*lc)->ld, msg, 0); in ldapModifyObjectClass()
2172 &stat); in ldapModifyObjectClass()
2175 stat == LDAP_REFERRAL && referralsp != NULL) { in ldapModifyObjectClass()
2176 releaseCon(*lc, stat); in ldapModifyObjectClass()
2180 *lc = findReferralCon(referralsp, &stat); in ldapModifyObjectClass()
2188 LDAP_OPT_ERROR_NUMBER, &stat); in ldapModifyObjectClass()
2191 stat = ldap_result((*lc)->ld, msgid, 0, &tv, &msg); in ldapModifyObjectClass()
2192 if (stat == 0) { in ldapModifyObjectClass()
2193 stat = LDAP_TIMEOUT; in ldapModifyObjectClass()
2194 } else if (stat == -1) { in ldapModifyObjectClass()
2196 LDAP_OPT_ERROR_NUMBER, &stat); in ldapModifyObjectClass()
2198 stat = ldap_parse_result((*lc)->ld, msg, &lderr, in ldapModifyObjectClass()
2200 if (stat == LDAP_SUCCESS) in ldapModifyObjectClass()
2201 stat = lderr; in ldapModifyObjectClass()
2208 return (stat); in ldapModifyObjectClass()
2224 int stat, add = 0; in ldapModify() local
2237 if ((lc = findCon(&stat)) == 0) in ldapModify()
2238 return (stat); in ldapModify()
2246 &stat); in ldapModify()
2250 stat = ldap_result(lc->ld, msgid, 0, &tv, &msg); in ldapModify()
2252 if (stat == 0) { in ldapModify()
2253 stat = LDAP_TIMEOUT; in ldapModify()
2254 } else if (stat == -1) { in ldapModify()
2256 &stat); in ldapModify()
2258 stat = ldap_parse_result(lc->ld, msg, &lderr, NULL, in ldapModify()
2260 if (stat == LDAP_SUCCESS) in ldapModify()
2261 stat = lderr; in ldapModify()
2264 stat == LDAP_REFERRAL && referralsp != NULL) { in ldapModify()
2265 releaseCon(lc, stat); in ldapModify()
2269 lc = findReferralCon(referralsp, &stat); in ldapModify()
2276 LDAP_OPT_ERROR_NUMBER, &stat); in ldapModify()
2279 stat = ldap_result(lc->ld, msgid, 0, &tv, &msg); in ldapModify()
2280 if (stat == 0) { in ldapModify()
2281 stat = LDAP_TIMEOUT; in ldapModify()
2282 } else if (stat == -1) { in ldapModify()
2284 LDAP_OPT_ERROR_NUMBER, &stat); in ldapModify()
2286 stat = ldap_parse_result(lc->ld, msg, &lderr, in ldapModify()
2288 if (stat == LDAP_SUCCESS) in ldapModify()
2289 stat = lderr; in ldapModify()
2293 if (stat == LDAP_NO_SUCH_OBJECT) in ldapModify()
2294 stat = LDAP_SUCCESS; in ldapModify()
2297 stat = ldapAdd(dn, rv, objClassAttrs, lc); in ldapModify()
2299 if (stat != LDAP_ALREADY_EXISTS) in ldapModify()
2301 if ((lc = findCon(&stat)) == 0) in ldapModify()
2302 return (stat); in ldapModify()
2311 stat = LDAP_PARAM_ERROR; in ldapModify()
2318 &stat); in ldapModify()
2322 stat = ldap_result(lc->ld, msgid, 0, &tv, &msg); in ldapModify()
2323 if (stat == 0) { in ldapModify()
2324 stat = LDAP_TIMEOUT; in ldapModify()
2325 } else if (stat == -1) { in ldapModify()
2327 &stat); in ldapModify()
2329 stat = ldap_parse_result(lc->ld, msg, &lderr, NULL, in ldapModify()
2331 if (stat == LDAP_SUCCESS) in ldapModify()
2332 stat = lderr; in ldapModify()
2335 stat == LDAP_REFERRAL && referralsp != NULL) { in ldapModify()
2336 releaseCon(lc, stat); in ldapModify()
2340 lc = findReferralCon(referralsp, &stat); in ldapModify()
2348 LDAP_OPT_ERROR_NUMBER, &stat); in ldapModify()
2351 stat = ldap_result(lc->ld, msgid, 0, &tv, &msg); in ldapModify()
2352 if (stat == 0) { in ldapModify()
2353 stat = LDAP_TIMEOUT; in ldapModify()
2354 } else if (stat == -1) { in ldapModify()
2356 LDAP_OPT_ERROR_NUMBER, &stat); in ldapModify()
2358 stat = ldap_parse_result(lc->ld, msg, &lderr, in ldapModify()
2360 if (stat == LDAP_SUCCESS) in ldapModify()
2361 stat = lderr; in ldapModify()
2372 if (stat == LDAP_OBJECT_CLASS_VIOLATION && in ldapModify()
2376 stat = ldapModifyObjectClass(&lc, dn, rv, in ldapModify()
2380 if (stat == LDAP_NO_SUCH_ATTRIBUTE) { in ldapModify()
2428 stat = LDAP_NO_MEMORY; in ldapModify()
2432 stat = ldapModify(dn, rvt, objClassAttrs, 0); in ldapModify()
2433 if (stat != LDAP_SUCCESS && in ldapModify()
2434 stat != LDAP_NO_SUCH_ATTRIBUTE) { in ldapModify()
2446 stat = LDAP_SUCCESS; in ldapModify()
2450 if (stat == LDAP_NO_SUCH_OBJECT && !addFirst) { in ldapModify()
2475 stat = LDAP_SUCCESS; in ldapModify()
2478 stat = LDAP_PARAM_ERROR; in ldapModify()
2480 stat = ldapAdd(dn, rv, objClassAttrs, lc); in ldapModify()
2487 if (stat != LDAP_SUCCESS) { in ldapModify()
2494 dn, stat, ldap_err2string(stat)); in ldapModify()
2497 releaseCon(lc, stat); in ldapModify()
2502 return (stat); in ldapModify()
2519 int stat; in ldapAdd() local
2534 if ((lc = findCon(&stat)) == 0) in ldapAdd()
2535 return (stat); in ldapAdd()
2540 stat = LDAP_OPERATIONS_ERROR; in ldapAdd()
2546 stat = LDAP_OPERATIONS_ERROR; in ldapAdd()
2552 (void) ldap_get_option(lc->ld, LDAP_OPT_ERROR_NUMBER, &stat); in ldapAdd()
2556 stat = ldap_result(lc->ld, msgid, 0, &tv, &msg); in ldapAdd()
2557 if (stat == 0) { in ldapAdd()
2558 stat = LDAP_TIMEOUT; in ldapAdd()
2559 } else if (stat == -1) { in ldapAdd()
2560 (void) ldap_get_option(lc->ld, LDAP_OPT_ERROR_NUMBER, &stat); in ldapAdd()
2562 stat = ldap_parse_result(lc->ld, msg, &lderr, NULL, NULL, in ldapAdd()
2564 if (stat == LDAP_SUCCESS) in ldapAdd()
2565 stat = lderr; in ldapAdd()
2567 if (proxyInfo.follow_referral == follow && stat == LDAP_REFERRAL && in ldapAdd()
2569 releaseCon(lc, stat); in ldapAdd()
2573 lc = findReferralCon(referralsp, &stat); in ldapAdd()
2580 LDAP_OPT_ERROR_NUMBER, &stat); in ldapAdd()
2583 stat = ldap_result(lc->ld, msgid, 0, &tv, &msg); in ldapAdd()
2584 if (stat == 0) { in ldapAdd()
2585 stat = LDAP_TIMEOUT; in ldapAdd()
2586 } else if (stat == -1) { in ldapAdd()
2588 &stat); in ldapAdd()
2590 stat = ldap_parse_result(lc->ld, msg, &lderr, NULL, in ldapAdd()
2592 if (stat == LDAP_SUCCESS) in ldapAdd()
2593 stat = lderr; in ldapAdd()
2598 if (stat != LDAP_SUCCESS) { in ldapAdd()
2603 dn, stat, ldap_err2string(stat)); in ldapAdd()
2606 releaseCon(lc, stat); in ldapAdd()
2611 return (stat); in ldapAdd()
2620 int stat; in ldapChangeDN() local
2637 if ((lc = findCon(&stat)) == 0) in ldapChangeDN()
2638 return (stat); in ldapChangeDN()
2660 stat = ldap_rename(lc->ld, oldDn, rdn, NULL, 1, NULL, NULL, &msgid); in ldapChangeDN()
2664 stat = ldap_result(lc->ld, msgid, 0, &tv, &msg); in ldapChangeDN()
2665 if (stat == 0) { in ldapChangeDN()
2666 stat = LDAP_TIMEOUT; in ldapChangeDN()
2667 } else if (stat == -1) { in ldapChangeDN()
2669 LDAP_OPT_ERROR_NUMBER, &stat); in ldapChangeDN()
2671 stat = ldap_parse_result(lc->ld, msg, &lderr, NULL, in ldapChangeDN()
2673 if (stat == LDAP_SUCCESS) in ldapChangeDN()
2674 stat = lderr; in ldapChangeDN()
2675 stat = ldap_result2error(lc->ld, msg, 0); in ldapChangeDN()
2679 &stat); in ldapChangeDN()
2682 stat == LDAP_REFERRAL && referralsp != NULL) { in ldapChangeDN()
2683 releaseCon(lc, stat); in ldapChangeDN()
2687 lc = findReferralCon(referralsp, &stat); in ldapChangeDN()
2696 LDAP_OPT_ERROR_NUMBER, &stat); in ldapChangeDN()
2699 stat = ldap_result(lc->ld, msgid, 0, &tv, &msg); in ldapChangeDN()
2700 if (stat == 0) { in ldapChangeDN()
2701 stat = LDAP_TIMEOUT; in ldapChangeDN()
2702 } else if (stat == -1) { in ldapChangeDN()
2704 LDAP_OPT_ERROR_NUMBER, &stat); in ldapChangeDN()
2706 stat = ldap_parse_result(lc->ld, msg, &lderr, in ldapChangeDN()
2708 if (stat == LDAP_SUCCESS) in ldapChangeDN()
2709 stat = lderr; in ldapChangeDN()
2720 ldap_err2string(stat)); in ldapChangeDN()
2724 ldap_err2string(stat)); in ldapChangeDN()
2727 if (stat == LDAP_NO_SUCH_OBJECT) { in ldapChangeDN()
2733 stat = LDAP_SUCCESS; in ldapChangeDN()
2736 releaseCon(lc, stat); in ldapChangeDN()
2739 return (stat); in ldapChangeDN()