Lines Matching refs:stat
184 int numLocDN, stat = 0, count = 0; in createLdapRequest() local
217 mit_ldap, mit_nisplus, rv, !fromLDAP, &stat); in createLdapRequest()
220 if (stat == NP_LDAP_RULES_NO_VALUE) in createLdapRequest()
222 stat = 0; in createLdapRequest()
443 int stat; in exclusiveLC() local
448 stat = mutex_trylock(&lc->mutex); in exclusiveLC()
449 if (stat == EBUSY && lc->owner != me) in exclusiveLC()
459 int stat; in assertExclusive() local
464 stat = mutex_trylock(&lc->mutex); in assertExclusive()
466 if (stat == 0) { in assertExclusive()
472 if (stat != EBUSY || lc->owner != me) in assertExclusive()
654 int stat; in disconnectCon() local
677 stat = ldap_unbind_s(lc->ld); in disconnectCon()
678 if (stat == LDAP_SUCCESS) { in disconnectCon()
688 myself, stat, ldap_err2string(stat)); in disconnectCon()
696 stat = LDAP_UNAVAILABLE; in disconnectCon()
699 return (stat); in disconnectCon()
718 int stat, i; in controlSupported() local
725 stat = ldap_search_st(lc->ld, "", LDAP_SCOPE_BASE, "(objectclass=*)", in controlSupported()
727 if (stat != LDAP_SUCCESS) { in controlSupported()
730 myself, NIL(lc->sp), ldap_err2string(stat)); in controlSupported()
731 return (stat); in controlSupported()
776 return (stat); in controlSupported()
789 int stat; in connectCon() local
818 stat = disconnectCon(lc); in connectCon()
819 if (stat != LDAP_SUCCESS) in connectCon()
820 return (stat); in connectCon()
842 stat = lc->status = ldapBind(&lc->ld, lc->who, lc->cred, lc->method, in connectCon()
857 return (stat); in connectCon()
864 findCon(int *stat) { in findCon() argument
869 if (stat == 0) in findCon()
870 stat = &ldapStat; in findCon()
877 if ((*stat = setupConList(proxyInfo.default_servers, in findCon()
889 *stat = connectCon(lc, 1); in findCon()
890 if (*stat != LDAP_SUCCESS) { in findCon()
891 if (*stat != LDAP_UNAVAILABLE) { in findCon()
895 ldap_err2string(*stat)); in findCon()
901 *stat = disconnectCon(lc); in findCon()
902 if (*stat != LDAP_UNAVAILABLE) in findCon()
919 int stat; in releaseCon() local
931 stat = disconnectCon(lc); in releaseCon()
933 stat = LDAP_SUCCESS; in releaseCon()
935 if (stat != LDAP_UNAVAILABLE) in releaseCon()
1086 LDAPURLDesc *ludpp, int *stat) in find_connection_from_list() argument
1090 if (stat == 0) in find_connection_from_list()
1091 stat = &ldapStat; in find_connection_from_list()
1093 *stat = LDAP_SUCCESS; in find_connection_from_list()
1099 *stat = connectCon(lc, 1); in find_connection_from_list()
1100 if (*stat != LDAP_SUCCESS) { in find_connection_from_list()
1119 findReferralCon(char **referralsp, int *stat) in findReferralCon() argument
1128 if (stat == 0) in findReferralCon()
1129 stat = &ldapStat; in findReferralCon()
1131 *stat = LDAP_SUCCESS; in findReferralCon()
1165 lc = find_connection_from_list(ldapReferralCon, ludpp, stat); in findReferralCon()
1167 lc = find_connection_from_list(ldapCon, ludpp, stat); in findReferralCon()
1199 *stat = LDAP_NO_MEMORY; in findReferralCon()
1215 lc = find_connection_from_list(ldapReferralCon, ludpp, stat); in findReferralCon()
1235 findYPCon(__nis_ldap_search_t *ls, int *stat) { in findYPCon() argument
1240 if (stat == 0) in findYPCon()
1241 stat = &ldapStat; in findYPCon()
1248 if ((*stat = setupConList(proxyInfo.default_servers, in findYPCon()
1261 *stat = disconnectCon(lc); in findYPCon()
1262 if (*stat != LDAP_UNAVAILABLE) in findYPCon()
1292 ldap_err2string(*stat)); in findYPCon()
1307 *stat = connectCon(lc, 1); in findYPCon()
1308 if (*stat != LDAP_SUCCESS) { in findYPCon()
1309 if (*stat != LDAP_UNAVAILABLE) { in findYPCon()
1313 ldap_err2string(*stat)); in findYPCon()
1350 int stat, numEntries, numVals, tnv, done, lprEc; in ldapSearch() local
1371 ldapStat = &stat; in ldapSearch()
1397 stat = ldap_create_sort_keylist(&sortKeyList, SORTKEYLIST); in ldapSearch()
1398 if (stat != LDAP_SUCCESS) { in ldapSearch()
1401 myself, ldap_err2string(stat)); in ldapSearch()
1403 *ldapStat = stat; in ldapSearch()
1407 stat = ldap_create_sort_control(lc->ld, sortKeyList, 1, in ldapSearch()
1409 if (stat == LDAP_SUCCESS) { in ldapSearch()
1417 ldap_get_option(lc->ld, LDAP_OPT_ERROR_NUMBER, &stat); in ldapSearch()
1420 myself, ldap_err2string(stat)); in ldapSearch()
1422 *ldapStat = stat; in ldapSearch()
1440 *ldapStat = stat; in ldapSearch()
1466 stat = ldap_create_virtuallist_control(lc->ld, in ldapSearch()
1468 if (stat != LDAP_SUCCESS) { in ldapSearch()
1470 &stat); in ldapSearch()
1473 myself, index, ldap_err2string(stat)); in ldapSearch()
1474 *ldapStat = stat; in ldapSearch()
1482 stat = ldap_search_ext_s(lc->ld, ls->base, in ldapSearch()
1490 stat = ldap_create_page_control(lc->ld, in ldapSearch()
1492 if (stat != LDAP_SUCCESS) { in ldapSearch()
1496 &stat); in ldapSearch()
1499 myself, ldap_err2string(stat)); in ldapSearch()
1501 *ldapStat = stat; in ldapSearch()
1506 stat = ldap_search_ext_s(lc->ld, ls->base, in ldapSearch()
1511 stat = ldap_search_st(lc->ld, ls->base, ls->scope, in ldapSearch()
1515 if (stat == LDAP_SUCCESS) in ldapSearch()
1516 ldap_get_option(lc->ld, LDAP_OPT_ERROR_NUMBER, &stat); in ldapSearch()
1518 if (stat == LDAP_SERVER_DOWN) { in ldapSearch()
1520 releaseCon(lc, stat); in ldapSearch()
1531 if (stat == LDAP_REFERRAL && follow_referral) { in ldapSearch()
1537 releaseCon(lc, stat); in ldapSearch()
1538 lc = findReferralCon(referralsp, &stat); in ldapSearch()
1543 *ldapStat = stat; in ldapSearch()
1546 stat = LDAP_SUCCESS; in ldapSearch()
1550 *ldapStat = stat; in ldapSearch()
1587 *ldapStat, ldap_err2string(stat)); in ldapSearch()
1682 stat = ldap_parse_result(lc->ld, msg, &lprEc, 0, 0, 0, in ldapSearch()
1684 if (stat != LDAP_SUCCESS) { in ldapSearch()
1686 &stat); in ldapSearch()
1689 myself, ldap_err2string(stat)); in ldapSearch()
1690 *ldapStat = stat; in ldapSearch()
1699 stat = ldap_parse_virtuallist_control(lc->ld, in ldapSearch()
1702 if (stat == LDAP_SUCCESS) { in ldapSearch()
1713 stat = ldap_parse_result(lc->ld, msg, &lprEc, 0, 0, 0, in ldapSearch()
1715 if (stat != LDAP_SUCCESS) { in ldapSearch()
1717 &stat); in ldapSearch()
1720 myself, ldap_err2string(stat)); in ldapSearch()
1721 *ldapStat = stat; in ldapSearch()
1733 stat = ldap_parse_page_control(lc->ld, in ldapSearch()
1735 if (stat == LDAP_SUCCESS) { in ldapSearch()
1795 releaseCon(lc, stat); in ldapSearch()
1799 releaseCon(lc, stat); in ldapSearch()
2051 int stat; in ldapModifyObjectClass() local
2067 stat = LDAP_OPERATIONS_ERROR; in ldapModifyObjectClass()
2149 stat = LDAP_OPERATIONS_ERROR; in ldapModifyObjectClass()
2158 stat = ldap_result((*lc)->ld, msgid, 0, &tv, &msg); in ldapModifyObjectClass()
2159 if (stat == 0) { in ldapModifyObjectClass()
2160 stat = LDAP_TIMEOUT; in ldapModifyObjectClass()
2161 } else if (stat == -1) { in ldapModifyObjectClass()
2163 LDAP_OPT_ERROR_NUMBER, &stat); in ldapModifyObjectClass()
2165 stat = ldap_parse_result((*lc)->ld, msg, &lderr, NULL, in ldapModifyObjectClass()
2167 if (stat == LDAP_SUCCESS) in ldapModifyObjectClass()
2168 stat = lderr; in ldapModifyObjectClass()
2169 stat = ldap_result2error((*lc)->ld, msg, 0); in ldapModifyObjectClass()
2173 &stat); in ldapModifyObjectClass()
2176 stat == LDAP_REFERRAL && referralsp != NULL) { in ldapModifyObjectClass()
2177 releaseCon(*lc, stat); in ldapModifyObjectClass()
2181 *lc = findReferralCon(referralsp, &stat); in ldapModifyObjectClass()
2189 LDAP_OPT_ERROR_NUMBER, &stat); in ldapModifyObjectClass()
2192 stat = ldap_result((*lc)->ld, msgid, 0, &tv, &msg); in ldapModifyObjectClass()
2193 if (stat == 0) { in ldapModifyObjectClass()
2194 stat = LDAP_TIMEOUT; in ldapModifyObjectClass()
2195 } else if (stat == -1) { in ldapModifyObjectClass()
2197 LDAP_OPT_ERROR_NUMBER, &stat); in ldapModifyObjectClass()
2199 stat = ldap_parse_result((*lc)->ld, msg, &lderr, in ldapModifyObjectClass()
2201 if (stat == LDAP_SUCCESS) in ldapModifyObjectClass()
2202 stat = lderr; in ldapModifyObjectClass()
2209 return (stat); in ldapModifyObjectClass()
2225 int stat, add = 0; in ldapModify() local
2239 if ((lc = findCon(&stat)) == 0) in ldapModify()
2240 return (stat); in ldapModify()
2248 &stat); in ldapModify()
2252 stat = ldap_result(lc->ld, msgid, 0, &tv, &msg); in ldapModify()
2254 if (stat == 0) { in ldapModify()
2255 stat = LDAP_TIMEOUT; in ldapModify()
2256 } else if (stat == -1) { in ldapModify()
2258 &stat); in ldapModify()
2260 stat = ldap_parse_result(lc->ld, msg, &lderr, NULL, in ldapModify()
2262 if (stat == LDAP_SUCCESS) in ldapModify()
2263 stat = lderr; in ldapModify()
2266 stat == LDAP_REFERRAL && referralsp != NULL) { in ldapModify()
2267 releaseCon(lc, stat); in ldapModify()
2271 lc = findReferralCon(referralsp, &stat); in ldapModify()
2278 LDAP_OPT_ERROR_NUMBER, &stat); in ldapModify()
2281 stat = ldap_result(lc->ld, msgid, 0, &tv, &msg); in ldapModify()
2282 if (stat == 0) { in ldapModify()
2283 stat = LDAP_TIMEOUT; in ldapModify()
2284 } else if (stat == -1) { in ldapModify()
2286 LDAP_OPT_ERROR_NUMBER, &stat); in ldapModify()
2288 stat = ldap_parse_result(lc->ld, msg, &lderr, in ldapModify()
2290 if (stat == LDAP_SUCCESS) in ldapModify()
2291 stat = lderr; in ldapModify()
2295 if (stat == LDAP_NO_SUCH_OBJECT) in ldapModify()
2296 stat = LDAP_SUCCESS; in ldapModify()
2299 stat = ldapAdd(dn, rv, objClassAttrs, lc); in ldapModify()
2301 if (stat != LDAP_ALREADY_EXISTS) in ldapModify()
2303 if ((lc = findCon(&stat)) == 0) in ldapModify()
2304 return (stat); in ldapModify()
2313 stat = LDAP_PARAM_ERROR; in ldapModify()
2320 &stat); in ldapModify()
2324 stat = ldap_result(lc->ld, msgid, 0, &tv, &msg); in ldapModify()
2325 if (stat == 0) { in ldapModify()
2326 stat = LDAP_TIMEOUT; in ldapModify()
2327 } else if (stat == -1) { in ldapModify()
2329 &stat); in ldapModify()
2331 stat = ldap_parse_result(lc->ld, msg, &lderr, NULL, in ldapModify()
2333 if (stat == LDAP_SUCCESS) in ldapModify()
2334 stat = lderr; in ldapModify()
2337 stat == LDAP_REFERRAL && referralsp != NULL) { in ldapModify()
2338 releaseCon(lc, stat); in ldapModify()
2342 lc = findReferralCon(referralsp, &stat); in ldapModify()
2350 LDAP_OPT_ERROR_NUMBER, &stat); in ldapModify()
2353 stat = ldap_result(lc->ld, msgid, 0, &tv, &msg); in ldapModify()
2354 if (stat == 0) { in ldapModify()
2355 stat = LDAP_TIMEOUT; in ldapModify()
2356 } else if (stat == -1) { in ldapModify()
2358 LDAP_OPT_ERROR_NUMBER, &stat); in ldapModify()
2360 stat = ldap_parse_result(lc->ld, msg, &lderr, in ldapModify()
2362 if (stat == LDAP_SUCCESS) in ldapModify()
2363 stat = lderr; in ldapModify()
2374 if (stat == LDAP_OBJECT_CLASS_VIOLATION && in ldapModify()
2378 stat = ldapModifyObjectClass(&lc, dn, rv, in ldapModify()
2382 if (stat == LDAP_NO_SUCH_ATTRIBUTE) { in ldapModify()
2430 stat = LDAP_NO_MEMORY; in ldapModify()
2434 stat = ldapModify(dn, rvt, objClassAttrs, 0); in ldapModify()
2435 if (stat != LDAP_SUCCESS && in ldapModify()
2436 stat != LDAP_NO_SUCH_ATTRIBUTE) { in ldapModify()
2448 stat = LDAP_SUCCESS; in ldapModify()
2452 if (stat == LDAP_NO_SUCH_OBJECT && !addFirst) { in ldapModify()
2477 stat = LDAP_SUCCESS; in ldapModify()
2480 stat = LDAP_PARAM_ERROR; in ldapModify()
2482 stat = ldapAdd(dn, rv, objClassAttrs, lc); in ldapModify()
2489 if (stat != LDAP_SUCCESS) { in ldapModify()
2496 dn, stat, ldap_err2string(stat)); in ldapModify()
2499 releaseCon(lc, stat); in ldapModify()
2504 return (stat); in ldapModify()
2521 int stat; in ldapAdd() local
2536 if ((lc = findCon(&stat)) == 0) in ldapAdd()
2537 return (stat); in ldapAdd()
2542 stat = LDAP_OPERATIONS_ERROR; in ldapAdd()
2548 stat = LDAP_OPERATIONS_ERROR; in ldapAdd()
2554 (void) ldap_get_option(lc->ld, LDAP_OPT_ERROR_NUMBER, &stat); in ldapAdd()
2558 stat = ldap_result(lc->ld, msgid, 0, &tv, &msg); in ldapAdd()
2559 if (stat == 0) { in ldapAdd()
2560 stat = LDAP_TIMEOUT; in ldapAdd()
2561 } else if (stat == -1) { in ldapAdd()
2562 (void) ldap_get_option(lc->ld, LDAP_OPT_ERROR_NUMBER, &stat); in ldapAdd()
2564 stat = ldap_parse_result(lc->ld, msg, &lderr, NULL, NULL, in ldapAdd()
2566 if (stat == LDAP_SUCCESS) in ldapAdd()
2567 stat = lderr; in ldapAdd()
2569 if (proxyInfo.follow_referral == follow && stat == LDAP_REFERRAL && in ldapAdd()
2571 releaseCon(lc, stat); in ldapAdd()
2575 lc = findReferralCon(referralsp, &stat); in ldapAdd()
2582 LDAP_OPT_ERROR_NUMBER, &stat); in ldapAdd()
2585 stat = ldap_result(lc->ld, msgid, 0, &tv, &msg); in ldapAdd()
2586 if (stat == 0) { in ldapAdd()
2587 stat = LDAP_TIMEOUT; in ldapAdd()
2588 } else if (stat == -1) { in ldapAdd()
2590 &stat); in ldapAdd()
2592 stat = ldap_parse_result(lc->ld, msg, &lderr, NULL, in ldapAdd()
2594 if (stat == LDAP_SUCCESS) in ldapAdd()
2595 stat = lderr; in ldapAdd()
2600 if (stat != LDAP_SUCCESS) { in ldapAdd()
2605 dn, stat, ldap_err2string(stat)); in ldapAdd()
2608 releaseCon(lc, stat); in ldapAdd()
2613 return (stat); in ldapAdd()
2622 int stat; in ldapChangeDN() local
2639 if ((lc = findCon(&stat)) == 0) in ldapChangeDN()
2640 return (stat); in ldapChangeDN()
2662 stat = ldap_rename(lc->ld, oldDn, rdn, NULL, 1, NULL, NULL, &msgid); in ldapChangeDN()
2666 stat = ldap_result(lc->ld, msgid, 0, &tv, &msg); in ldapChangeDN()
2667 if (stat == 0) { in ldapChangeDN()
2668 stat = LDAP_TIMEOUT; in ldapChangeDN()
2669 } else if (stat == -1) { in ldapChangeDN()
2671 LDAP_OPT_ERROR_NUMBER, &stat); in ldapChangeDN()
2673 stat = ldap_parse_result(lc->ld, msg, &lderr, NULL, in ldapChangeDN()
2675 if (stat == LDAP_SUCCESS) in ldapChangeDN()
2676 stat = lderr; in ldapChangeDN()
2677 stat = ldap_result2error(lc->ld, msg, 0); in ldapChangeDN()
2681 &stat); in ldapChangeDN()
2684 stat == LDAP_REFERRAL && referralsp != NULL) { in ldapChangeDN()
2685 releaseCon(lc, stat); in ldapChangeDN()
2689 lc = findReferralCon(referralsp, &stat); in ldapChangeDN()
2698 LDAP_OPT_ERROR_NUMBER, &stat); in ldapChangeDN()
2701 stat = ldap_result(lc->ld, msgid, 0, &tv, &msg); in ldapChangeDN()
2702 if (stat == 0) { in ldapChangeDN()
2703 stat = LDAP_TIMEOUT; in ldapChangeDN()
2704 } else if (stat == -1) { in ldapChangeDN()
2706 LDAP_OPT_ERROR_NUMBER, &stat); in ldapChangeDN()
2708 stat = ldap_parse_result(lc->ld, msg, &lderr, in ldapChangeDN()
2710 if (stat == LDAP_SUCCESS) in ldapChangeDN()
2711 stat = lderr; in ldapChangeDN()
2722 ldap_err2string(stat)); in ldapChangeDN()
2726 ldap_err2string(stat)); in ldapChangeDN()
2729 if (stat == LDAP_NO_SUCH_OBJECT) { in ldapChangeDN()
2735 stat = LDAP_SUCCESS; in ldapChangeDN()
2738 releaseCon(lc, stat); in ldapChangeDN()
2741 return (stat); in ldapChangeDN()