diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
commit | 6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch) | |
tree | 850c71039563c16a5d563c47e7ba2ab645baf198 /source3/lib/tldap.c | |
parent | 6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff) | |
parent | 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff) | |
download | samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.gz samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.bz2 samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.zip |
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16
Diffstat (limited to 'source3/lib/tldap.c')
-rw-r--r-- | source3/lib/tldap.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c index cd1dea52ba..8b04d00636 100644 --- a/source3/lib/tldap.c +++ b/source3/lib/tldap.c @@ -20,6 +20,8 @@ #include "includes.h" #include "tldap.h" #include "../lib/util/asn1.h" +#include "../lib/tsocket/tsocket.h" +#include "../lib/util/tevent_unix.h" static int tldap_simple_recv(struct tevent_req *req); @@ -187,7 +189,7 @@ bool tldap_context_setattr(struct tldap_context *ld, struct tldap_ctx_attribute *tmp, *attr; char *tmpname; int num_attrs; - void **pptr = (void **)_pptr; + void **pptr = (void **)discard_const_p(void,_pptr); attr = tldap_context_findattr(ld, name); if (attr != NULL) { @@ -539,7 +541,7 @@ static void tldap_msg_sent(struct tevent_req *subreq) } if (!tldap_msg_set_pending(req)) { - tevent_req_nomem(NULL, req); + tevent_req_oom(req); return; } } @@ -933,10 +935,10 @@ struct tevent_req *tldap_simple_bind_send(TALLOC_CTX *mem_ctx, DATA_BLOB cred; if (passwd != NULL) { - cred.data = (uint8_t *)passwd; + cred.data = discard_const_p(uint8_t, passwd); cred.length = strlen(passwd); } else { - cred.data = (uint8_t *)""; + cred.data = discard_const_p(uint8_t, ""); cred.length = 0; } return tldap_sasl_bind_send(mem_ctx, ev, ld, dn, NULL, &cred, NULL, 0, @@ -954,10 +956,10 @@ int tldap_simple_bind(struct tldap_context *ld, const char *dn, DATA_BLOB cred; if (passwd != NULL) { - cred.data = (uint8_t *)passwd; + cred.data = discard_const_p(uint8_t, passwd); cred.length = strlen(passwd); } else { - cred.data = (uint8_t *)""; + cred.data = discard_const_p(uint8_t, ""); cred.length = 0; } return tldap_sasl_bind(ld, dn, NULL, &cred, NULL, 0, NULL, 0); @@ -1373,7 +1375,7 @@ static bool tldap_push_filter_basic(struct tldap_context *ld, return false; } - if (StrnCaseCmp(dn, "dn:", 3) != 0) { + if (strncasecmp_m(dn, "dn:", 3) != 0) { if (rule == e) { rule = dn; dn = NULL; @@ -1701,7 +1703,7 @@ static void tldap_search_done(struct tevent_req *subreq) case TLDAP_RES_SEARCH_ENTRY: case TLDAP_RES_SEARCH_REFERENCE: if (!tldap_msg_set_pending(subreq)) { - tevent_req_nomem(NULL, req); + tevent_req_oom(req); return; } tevent_req_notify_callback(req); |