From a73bd05eec608d29888286542e9c882039b02857 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 16 Mar 2009 10:13:34 +0100 Subject: s3: only define TALLOC_ZERO if needed metze --- source3/include/smb_macros.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index fd1bba16a7..22cfaaf581 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -256,7 +256,9 @@ NULL returns on zero request. JRA. #define TALLOC_REALLOC(ctx, ptr, count) _talloc_realloc(ctx, ptr, count, __location__) #define TALLOC_REALLOC_ARRAY(ctx, ptr, type, count) (type *)_talloc_realloc_array(ctx, ptr, sizeof(type), count, #type) #define talloc_destroy(ctx) talloc_free(ctx) +#ifndef TALLOC_FREE #define TALLOC_FREE(ctx) do { talloc_free(ctx); ctx=NULL; } while(0) +#endif /* only define PARANOID_MALLOC_CHECKER with --enable-developer */ -- cgit From 20cee26a3dbd231672eec9133c6e84641def298d Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 16 Mar 2009 19:15:26 +0100 Subject: Convert open_socket_out_defer to tevent_req --- source3/include/proto.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index f992f0686a..36aad9880c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1396,13 +1396,13 @@ struct tevent_req *open_socket_out_send(TALLOC_CTX *mem_ctx, uint16_t port, int timeout); NTSTATUS open_socket_out_recv(struct tevent_req *req, int *pfd); -struct async_req *open_socket_out_defer_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct timeval wait_time, - const struct sockaddr_storage *pss, - uint16_t port, - int timeout); -NTSTATUS open_socket_out_defer_recv(struct async_req *req, int *pfd); +struct tevent_req *open_socket_out_defer_send(TALLOC_CTX *mem_ctx, + struct event_context *ev, + struct timeval wait_time, + const struct sockaddr_storage *pss, + uint16_t port, + int timeout); +NTSTATUS open_socket_out_defer_recv(struct tevent_req *req, int *pfd); bool open_any_socket_out(struct sockaddr_storage *addrs, int num_addrs, int timeout, int *fd_index, int *fd); int open_udp_socket(const char *host, int port); -- cgit From a58eccfee742bcecbd4a2e5662305c5077024244 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 16 Mar 2009 20:23:37 +0100 Subject: Make struct wb_context private to wbclient.c --- source3/include/wbc_async.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/wbc_async.h b/source3/include/wbc_async.h index fd9b669710..987c32320c 100644 --- a/source3/include/wbc_async.h +++ b/source3/include/wbc_async.h @@ -22,11 +22,7 @@ #include "nsswitch/libwbclient/wbclient.h" -struct wb_context { - struct async_req_queue *queue; - int fd; - bool is_priv; -}; +struct wb_context; struct async_req *wb_trans_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct wb_context *wb_ctx, bool need_priv, -- cgit From 05b49fd4c8aaf779b98eb2eabb860295dc1300b9 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 16 Mar 2009 20:38:11 +0100 Subject: Convert wb_trans to tevent_req --- source3/include/wbc_async.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/wbc_async.h b/source3/include/wbc_async.h index 987c32320c..37f500ea1c 100644 --- a/source3/include/wbc_async.h +++ b/source3/include/wbc_async.h @@ -24,10 +24,11 @@ struct wb_context; -struct async_req *wb_trans_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, - struct wb_context *wb_ctx, bool need_priv, - struct winbindd_request *wb_req); -wbcErr wb_trans_recv(struct async_req *req, TALLOC_CTX *mem_ctx, +struct tevent_req *wb_trans_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct wb_context *wb_ctx, bool need_priv, + struct winbindd_request *wb_req); +wbcErr wb_trans_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, struct winbindd_response **presponse); struct wb_context *wb_context_init(TALLOC_CTX *mem_ctx); -- cgit From 8a2b7b3e56230c46df9ae3820578a2f3e765d32d Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 16 Mar 2009 21:02:26 +0100 Subject: Remove unused async_req references from wb_reqtrans.c --- source3/include/wbc_async.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/wbc_async.h b/source3/include/wbc_async.h index 37f500ea1c..eaec0d11da 100644 --- a/source3/include/wbc_async.h +++ b/source3/include/wbc_async.h @@ -33,9 +33,7 @@ wbcErr wb_trans_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, struct wb_context *wb_context_init(TALLOC_CTX *mem_ctx); /* Definitions from wb_reqtrans.c */ -bool async_req_is_wbcerr(struct async_req *req, wbcErr *pwbc_err); wbcErr map_wbc_err_from_errno(int error); -wbcErr async_req_simple_recv_wbcerr(struct async_req *req); bool tevent_req_is_wbcerr(struct tevent_req *req, wbcErr *pwbc_err); wbcErr tevent_req_simple_recv_wbcerr(struct tevent_req *req); -- cgit From 382d8069adcc49e351eef63d86036ae553b119a2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 16 Mar 2009 16:38:15 -0700 Subject: Add some appropriate const. Jeremy. --- source3/include/proto.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 36aad9880c..6016ae751b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1072,26 +1072,26 @@ const char *my_netbios_names(int i); bool set_netbios_aliases(const char **str_array); bool init_names(void); struct user_auth_info *user_auth_info_init(TALLOC_CTX *mem_ctx); -const char *get_cmdline_auth_info_username(struct user_auth_info *auth_info); +const char *get_cmdline_auth_info_username(const struct user_auth_info *auth_info); void set_cmdline_auth_info_username(struct user_auth_info *auth_info, const char *username); void set_cmdline_auth_info_password(struct user_auth_info *auth_info, const char *password); -const char *get_cmdline_auth_info_password(struct user_auth_info *auth_info); +const char *get_cmdline_auth_info_password(const struct user_auth_info *auth_info); bool set_cmdline_auth_info_signing_state(struct user_auth_info *auth_info, const char *arg); -int get_cmdline_auth_info_signing_state(struct user_auth_info *auth_info); +int get_cmdline_auth_info_signing_state(const struct user_auth_info *auth_info); void set_cmdline_auth_info_use_kerberos(struct user_auth_info *auth_info, bool b); -bool get_cmdline_auth_info_use_kerberos(struct user_auth_info *auth_info); +bool get_cmdline_auth_info_use_kerberos(const struct user_auth_info *auth_info); void set_cmdline_auth_info_use_krb5_ticket(struct user_auth_info *auth_info); void set_cmdline_auth_info_smb_encrypt(struct user_auth_info *auth_info); void set_cmdline_auth_info_use_machine_account(struct user_auth_info *auth_info); -bool get_cmdline_auth_info_got_pass(struct user_auth_info *auth_info); -bool get_cmdline_auth_info_smb_encrypt(struct user_auth_info *auth_info); -bool get_cmdline_auth_info_use_machine_account(struct user_auth_info *auth_info); +bool get_cmdline_auth_info_got_pass(const struct user_auth_info *auth_info); +bool get_cmdline_auth_info_smb_encrypt(const struct user_auth_info *auth_info); +bool get_cmdline_auth_info_use_machine_account(const struct user_auth_info *auth_info); struct user_auth_info *get_cmdline_auth_info_copy(TALLOC_CTX *mem_ctx, - struct user_auth_info *info); + const struct user_auth_info *info); bool set_cmdline_auth_info_machine_account_creds(struct user_auth_info *auth_info); bool add_gid_to_array_unique(TALLOC_CTX *mem_ctx, gid_t gid, gid_t **gids, size_t *num_gids); -- cgit