From 12476223c6aa7473c55bcf529639eefce8450680 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 28 Apr 2011 17:26:40 +0200 Subject: s3-tsocket: only include ../lib/tsocket/tsocket.h where needed. Guenther --- source3/lib/tldap.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/lib/tldap.c') diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c index cd1dea52ba5..b5be3a8e24a 100644 --- a/source3/lib/tldap.c +++ b/source3/lib/tldap.c @@ -20,6 +20,7 @@ #include "includes.h" #include "tldap.h" #include "../lib/util/asn1.h" +#include "../lib/tsocket/tsocket.h" static int tldap_simple_recv(struct tevent_req *req); -- cgit From 50883cfeb4eed3d538f71443060745f8747044c9 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 28 Apr 2011 17:38:09 +0200 Subject: s3-tevent: only include ../lib/util/tevent wrappers where needed. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guenther Autobuild-User: Günther Deschner Autobuild-Date: Fri Apr 29 14:00:30 CEST 2011 on sn-devel-104 --- source3/lib/tldap.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/lib/tldap.c') diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c index b5be3a8e24a..ba27028649e 100644 --- a/source3/lib/tldap.c +++ b/source3/lib/tldap.c @@ -21,6 +21,7 @@ #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); -- cgit From 4f41be356a4e6b311d30de3b2e36e4c33aa72ca3 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 5 May 2011 10:41:59 -0700 Subject: Fix many const compiler warnings. --- source3/lib/tldap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/lib/tldap.c') diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c index ba27028649e..3afdaea4194 100644 --- a/source3/lib/tldap.c +++ b/source3/lib/tldap.c @@ -189,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) { @@ -935,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, @@ -956,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); -- cgit From da662b82b87cdbe07762974b1f9e825ef15951bd Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 13 May 2011 20:23:36 +0200 Subject: s3-lib Replace StrnCaseCmp() with strncasecmp_m() strncasecmp_m() never needs to call to talloc, and via next_codepoint() still has an ASCII fast-path bypassing iconv() calls. Andrew Bartlett --- source3/lib/tldap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib/tldap.c') diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c index 3afdaea4194..c2f5b2ced71 100644 --- a/source3/lib/tldap.c +++ b/source3/lib/tldap.c @@ -1375,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; -- cgit From f0ff6f390a14b0da8466096c0886f5c4860b977f Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 19 Jun 2011 21:10:01 +0200 Subject: Use tevent_req_oom This fixes a few Coverity errors --- source3/lib/tldap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/lib/tldap.c') diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c index c2f5b2ced71..8b04d006367 100644 --- a/source3/lib/tldap.c +++ b/source3/lib/tldap.c @@ -541,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; } } @@ -1703,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); -- cgit