Lines Matching refs:rc
235 static CURLcode oldap_map_error(int rc, CURLcode result) in oldap_map_error() argument
237 switch(rc) { in oldap_map_error()
253 int rc = LDAP_URL_ERR_BADURL; in oldap_url_parse() local
271 rc = ldap_url_parse(data->state.url, ludp); in oldap_url_parse()
272 if(rc != LDAP_URL_SUCCESS) { in oldap_url_parse()
275 result = rc == LDAP_URL_ERR_MEM ? CURLE_OUT_OF_MEMORY : in oldap_url_parse()
277 rc -= LDAP_URL_SUCCESS; in oldap_url_parse()
278 if((size_t) rc < sizeof(url_errs) / sizeof(url_errs[0])) in oldap_url_parse()
279 msg = url_errs[rc]; in oldap_url_parse()
353 int rc; in oldap_perform_auth() local
359 rc = ldap_sasl_bind(li->ld, NULL, mech, pcred, NULL, NULL, &li->msgid); in oldap_perform_auth()
360 if(rc != LDAP_SUCCESS) in oldap_perform_auth()
361 return oldap_map_error(rc, CURLE_LDAP_CANNOT_BIND); in oldap_perform_auth()
375 int rc; in oldap_continue_auth() local
381 rc = ldap_sasl_bind(li->ld, NULL, mech, pcred, NULL, NULL, &li->msgid); in oldap_continue_auth()
382 if(rc != LDAP_SUCCESS) in oldap_continue_auth()
383 return oldap_map_error(rc, CURLE_LDAP_CANNOT_BIND); in oldap_continue_auth()
393 int rc = ldap_sasl_bind(li->ld, NULL, LDAP_SASL_NULL, NULL, NULL, NULL, in oldap_cancel_auth() local
397 if(rc != LDAP_SUCCESS) in oldap_cancel_auth()
398 return oldap_map_error(rc, CURLE_LDAP_CANNOT_BIND); in oldap_cancel_auth()
409 int rc; in oldap_perform_bind() local
420 rc = ldap_sasl_bind(li->ld, binddn, LDAP_SASL_SIMPLE, &passwd, in oldap_perform_bind()
422 if(rc != LDAP_SUCCESS) in oldap_perform_bind()
423 return oldap_map_error(rc, in oldap_perform_bind()
434 int rc; in oldap_perform_mechs() local
440 rc = ldap_search_ext(li->ld, "", LDAP_SCOPE_BASE, "(objectclass=*)", in oldap_perform_mechs()
443 if(rc != LDAP_SUCCESS) in oldap_perform_mechs()
444 return oldap_map_error(rc, CURLE_LOGIN_DENIED); in oldap_perform_mechs()
497 int rc = ldap_start_tls(li->ld, NULL, NULL, &li->msgid); in oldap_perform_starttls() local
499 if(rc != LDAP_SUCCESS) in oldap_perform_starttls()
500 return oldap_map_error(rc, CURLE_USE_SSL_FAILED); in oldap_perform_starttls()
511 int rc; in oldap_connect() local
548 rc = ldap_init_fd(conn->sock[FIRSTSOCKET], li->proto, hosturl, &li->ld); in oldap_connect()
549 if(rc) { in oldap_connect()
551 hosturl, ldap_err2string(rc)); in oldap_connect()
599 int rc; in oldap_state_mechs_resp() local
610 rc = ldap_get_dn_ber(li->ld, msg, &ber, &bv); in oldap_state_mechs_resp()
611 if(rc < 0) in oldap_state_mechs_resp()
612 return oldap_map_error(rc, CURLE_BAD_CONTENT_ENCODING); in oldap_state_mechs_resp()
613 for(rc = ldap_get_attribute_ber(li->ld, msg, ber, &bv, &bvals); in oldap_state_mechs_resp()
614 rc == LDAP_SUCCESS; in oldap_state_mechs_resp()
615 rc = ldap_get_attribute_ber(li->ld, msg, ber, &bv, &bvals)) { in oldap_state_mechs_resp()
666 int rc; in oldap_state_sasl_resp() local
669 rc = ldap_parse_sasl_bind_result(li->ld, msg, &li->servercred, 0); in oldap_state_sasl_resp()
670 if(rc != LDAP_SUCCESS) { in oldap_state_sasl_resp()
671 failf(data, "LDAP local: sasl ldap_parse_result %s", ldap_err2string(rc)); in oldap_state_sasl_resp()
672 result = oldap_map_error(rc, CURLE_LOGIN_DENIED); in oldap_state_sasl_resp()
693 int rc; in oldap_state_bind_resp() local
698 rc = ldap_parse_sasl_bind_result(li->ld, msg, &bv, 0); in oldap_state_bind_resp()
699 if(rc != LDAP_SUCCESS) { in oldap_state_bind_resp()
701 ldap_err2string(rc)); in oldap_state_bind_resp()
702 result = oldap_map_error(rc, CURLE_LDAP_CANNOT_BIND); in oldap_state_bind_resp()
720 int rc; in oldap_connecting() local
724 rc = ldap_result(li->ld, li->msgid, LDAP_MSG_ONE, &tv, &msg); in oldap_connecting()
725 switch(rc) { in oldap_connecting()
733 if(rc < 0) { in oldap_connecting()
735 ldap_err2string(rc)); in oldap_connecting()
736 return oldap_map_error(rc, CURLE_COULDNT_CONNECT); in oldap_connecting()
742 rc = ldap_parse_result(li->ld, msg, &code, NULL, NULL, NULL, NULL, 0); in oldap_connecting()
743 if(rc) in oldap_connecting()
744 code = rc; in oldap_connecting()
874 int rc; in oldap_do() local
893 rc = ldap_search_ext(li->ld, lud->lud_dn, lud->lud_scope, in oldap_do()
897 if(rc != LDAP_SUCCESS) { in oldap_do()
898 failf(data, "LDAP local: ldap_search_ext %s", ldap_err2string(rc)); in oldap_do()
970 int rc; in oldap_recv() local
984 rc = ldap_result(li->ld, lr->msgid, LDAP_MSG_ONE, &tv, &msg); in oldap_recv()
985 if(rc < 0) { in oldap_recv()
986 failf(data, "LDAP local: search ldap_result %s", ldap_err2string(rc)); in oldap_recv()
1001 rc = ldap_parse_result(li->ld, msg, &code, NULL, &info, NULL, NULL, 0); in oldap_recv()
1002 if(rc) { in oldap_recv()
1004 ldap_err2string(rc)); in oldap_recv()
1030 rc = ldap_get_dn_ber(li->ld, msg, &ber, &bv); in oldap_recv()
1031 if(rc < 0) { in oldap_recv()
1041 for(rc = ldap_get_attribute_ber(li->ld, msg, ber, &bv, &bvals); in oldap_recv()
1042 rc == LDAP_SUCCESS; in oldap_recv()
1043 rc = ldap_get_attribute_ber(li->ld, msg, ber, &bv, &bvals)) { in oldap_recv()