The branch, master has been updated via 551e268 tldap: Use struct initializer in tldap_search via 8842235 tldap: Avoid includes.h via 093a89f tldap.h: References DATA_BLOB via 5021974 lib: Introduce util_tsock.h via 3df9e9c tldap: tevent_req_create NULLs out "state" via e481849 tldap: Use "size_t" for talloc_array_length result via 8215409 tldap: Remove an unneeded "return;" via 245064d tldap: Remove unneeded vars from 657610a smbd: Fix 240393 Uninitialized pointer read
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 551e268ac307bd352b2d45d3089319294261c9cd Author: Volker Lendecke <v...@samba.org> Date: Mon Dec 21 21:29:13 2015 +0100 tldap: Use struct initializer in tldap_search Avoids a call to ZERO_STRUCT Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Ralph Boehme <s...@samba.org> Autobuild-User(master): Ralph Böhme <s...@samba.org> Autobuild-Date(master): Mon Jan 11 01:31:59 CET 2016 on sn-devel-144 commit 8842235a82bbf8fb65d23fa38d87c16c58040dce Author: Volker Lendecke <v...@samba.org> Date: Mon Dec 21 11:17:28 2015 +0100 tldap: Avoid includes.h Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Ralph Boehme <s...@samba.org> commit 093a89f6ecf706e1cc4ea838b09b2a83ed4cbe10 Author: Volker Lendecke <v...@samba.org> Date: Sun Jan 10 12:00:52 2016 +0100 tldap.h: References DATA_BLOB Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Ralph Boehme <s...@samba.org> commit 5021974f2ab8a1318e2a0e7f51a8a988cd1820cb Author: Volker Lendecke <v...@samba.org> Date: Mon Dec 21 10:50:59 2015 +0100 lib: Introduce util_tsock.h This avoids includes.h in source3/lib/util_tsock.c Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Ralph Boehme <s...@samba.org> commit 3df9e9c7aeb95ee5f5292c35bf0628b51b32b8b1 Author: Volker Lendecke <v...@samba.org> Date: Tue Dec 22 13:44:02 2015 +0100 tldap: tevent_req_create NULLs out "state" Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Ralph Boehme <s...@samba.org> commit e48184935e1f4c6a3876a054ed4031b23ed0df7a Author: Volker Lendecke <v...@samba.org> Date: Sun Jan 10 11:29:40 2016 +0100 tldap: Use "size_t" for talloc_array_length result Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Ralph Boehme <s...@samba.org> commit 8215409153d15cbf96ac9103d355c8c5ea71ea13 Author: Volker Lendecke <v...@samba.org> Date: Sun Jan 10 11:33:01 2016 +0100 tldap: Remove an unneeded "return;" Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Ralph Boehme <s...@samba.org> commit 245064d5a3b46491d446dbf2186412b1a0933ef9 Author: Volker Lendecke <v...@samba.org> Date: Sun Dec 27 15:31:58 2015 +0100 tldap: Remove unneeded vars Signed-off-by: Volker Lendecke <v...@samba.org> Reviewed-by: Ralph Boehme <s...@samba.org> ----------------------------------------------------------------------- Summary of changes: source3/include/proto.h | 11 -------- source3/include/tldap.h | 1 + source3/lib/tldap.c | 23 ++++++++--------- source3/lib/util_tsock.c | 5 +++- source3/lib/{tevent_barrier.h => util_tsock.h} | 35 +++++++++++++------------- source3/libsmb/unexpected.c | 1 + 6 files changed, 34 insertions(+), 42 deletions(-) copy source3/lib/{tevent_barrier.h => util_tsock.h} (56%) Changeset truncated at 500 lines: diff --git a/source3/include/proto.h b/source3/include/proto.h index cc00a84..a53aabd 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -600,17 +600,6 @@ struct tevent_req *getaddrinfo_send(TALLOC_CTX *mem_ctx, int getaddrinfo_recv(struct tevent_req *req, struct addrinfo **res); int poll_one_fd(int fd, int events, int timeout, int *revents); int poll_intr_one_fd(int fd, int events, int timeout, int *revents); -struct tstream_context; -struct tevent_req *tstream_read_packet_send(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - struct tstream_context *stream, - size_t initial, - ssize_t (*more)(uint8_t *buf, - size_t buflen, - void *private_data), - void *private_data); -ssize_t tstream_read_packet_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, - uint8_t **pbuf, int *perrno); /* The following definitions come from lib/util_str.c */ diff --git a/source3/include/tldap.h b/source3/include/tldap.h index 36cbdce..1c704b4 100644 --- a/source3/include/tldap.h +++ b/source3/include/tldap.h @@ -22,6 +22,7 @@ #include <talloc.h> #include <tevent.h> +#include "lib/util/data_blob.h" struct tldap_context; struct tldap_message; diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c index 17238a5..d8b4f24 100644 --- a/source3/lib/tldap.c +++ b/source3/lib/tldap.c @@ -17,8 +17,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "includes.h" +#include "replace.h" #include "tldap.h" +#include "system/network.h" +#include "system/locale.h" +#include "lib/util/talloc_stack.h" +#include "lib/util/samba_util.h" +#include "lib/util_tsock.h" #include "../lib/util/asn1.h" #include "../lib/tsocket/tsocket.h" #include "../lib/util/tevent_unix.h" @@ -57,9 +62,6 @@ struct tldap_ctx_attribute { struct tldap_context { int ld_version; - int ld_deref; - int ld_sizelimit; - int ld_timelimit; struct tstream_context *conn; bool server_down; int msgid; @@ -171,7 +173,7 @@ bool tldap_connection_ok(struct tldap_context *ld) static struct tldap_ctx_attribute *tldap_context_findattr( struct tldap_context *ld, const char *name) { - int i, num_attrs; + size_t i, num_attrs; num_attrs = talloc_array_length(ld->ctx_attrs); @@ -485,7 +487,6 @@ static void tldap_msg_unset_pending(struct tevent_req *req) */ ld->pending = talloc_realloc(NULL, ld->pending, struct tevent_req *, num_pending - 1); - return; } static void tldap_msg_cleanup(struct tevent_req *req, @@ -723,12 +724,10 @@ static struct tevent_req *tldap_req_create(TALLOC_CTX *mem_ctx, if (req == NULL) { return NULL; } - ZERO_STRUCTP(state); state->out = asn1_init(state); if (state->out == NULL) { goto err; } - state->result = NULL; state->id = tldap_next_msgid(ld); if (!asn1_push_tag(state->out, ASN1_SEQUENCE(0))) goto err; @@ -1841,11 +1840,9 @@ int tldap_search(struct tldap_context *ld, TALLOC_CTX *frame = talloc_stackframe(); struct tevent_context *ev; struct tevent_req *req; - struct tldap_sync_search_state state; - - ZERO_STRUCT(state); - state.mem_ctx = mem_ctx; - state.rc = TLDAP_SUCCESS; + struct tldap_sync_search_state state = { + .mem_ctx = mem_ctx, .rc = TLDAP_SUCCESS + }; ev = samba_tevent_context_init(frame); if (ev == NULL) { diff --git a/source3/lib/util_tsock.c b/source3/lib/util_tsock.c index 03380ef..6432ce4 100644 --- a/source3/lib/util_tsock.c +++ b/source3/lib/util_tsock.c @@ -17,7 +17,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "includes.h" +#include "replace.h" +#include "system/network.h" +#include <tevent.h> +#include "lib/util_tsock.h" #include "../lib/tsocket/tsocket.h" #include "../lib/util/tevent_unix.h" diff --git a/source3/lib/tevent_barrier.h b/source3/lib/util_tsock.h similarity index 56% copy from source3/lib/tevent_barrier.h copy to source3/lib/util_tsock.h index 2b35852..de4381a 100644 --- a/source3/lib/tevent_barrier.h +++ b/source3/lib/util_tsock.h @@ -1,7 +1,7 @@ /* Unix SMB/CIFS implementation. - Implement a barrier - Copyright (C) Volker Lendecke 2012 + Utilities around tsocket + Copyright (C) Volker Lendecke 2009 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,21 +17,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef _TEVENT_BARRIER_H -#define _TEVENT_BARRIER_H +#ifndef __UTIL_TSOCK_H__ +#define __UTIL_TSOCK_H__ -#include "talloc.h" -#include "tevent.h" +#include "replace.h" +#include <tevent.h> -struct tevent_barrier; - -struct tevent_barrier *tevent_barrier_init( - TALLOC_CTX *mem_ctx, unsigned count, - void (*trigger_cb)(void *private_data), void *private_data); - -struct tevent_req *tevent_barrier_wait_send(TALLOC_CTX *mem_ctx, +struct tstream_context; +struct tevent_req *tstream_read_packet_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct tevent_barrier *b); -int tevent_barrier_wait_recv(struct tevent_req *req); - -#endif /* _TEVENT_BARRIER_H */ + struct tstream_context *stream, + size_t initial, + ssize_t (*more)(uint8_t *buf, + size_t buflen, + void *private_data), + void *private_data); +ssize_t tstream_read_packet_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, + uint8_t **pbuf, int *perrno); + +#endif diff --git a/source3/libsmb/unexpected.c b/source3/libsmb/unexpected.c index 27d21b6..c645fbc 100644 --- a/source3/libsmb/unexpected.c +++ b/source3/libsmb/unexpected.c @@ -20,6 +20,7 @@ #include "includes.h" #include "../lib/util/tevent_ntstatus.h" +#include "lib/util_tsock.h" #include "lib/tsocket/tsocket.h" #include "libsmb/nmblib.h" #include "lib/util/sys_rw.h" -- Samba Shared Repository