From: Jelmer Vernooij Date: Sat, 8 Sep 2007 13:34:42 +0000 (+0000) Subject: r25028: Fix more warnings. X-Git-Tag: samba-4.0.0alpha6~801^3~1979 X-Git-Url: http://git.samba.org/samba.git/?p=gd%2Fsamba-autobuild%2F.git;a=commitdiff_plain;h=7a287e07043cf937e22f8051c1a324d8a30c53e1 r25028: Fix more warnings. (This used to be commit 3aa7ee4a0d8837471deeaa1c5a1f4a0d2a14aa6e) --- diff --git a/source4/client/cifsddio.c b/source4/client/cifsddio.c index 7dc9b8d081b..86231617520 100644 --- a/source4/client/cifsddio.c +++ b/source4/client/cifsddio.c @@ -149,16 +149,14 @@ struct cifs_handle #define IO_HANDLE_TO_SMB(h) ((struct cifs_handle *)(h)) -BOOL smb_seek_func(void * handle, uint64_t offset) +static bool smb_seek_func(void * handle, uint64_t offset) { IO_HANDLE_TO_SMB(handle)->offset = offset; return(True); } -BOOL smb_read_func(void * handle, - uint8_t * buf, - uint64_t wanted, - uint64_t * actual) +static bool smb_read_func(void * handle, uint8_t * buf, uint64_t wanted, + uint64_t * actual) { NTSTATUS ret; union smb_read r; @@ -193,10 +191,8 @@ BOOL smb_read_func(void * handle, return(True); } -BOOL smb_write_func(void * handle, - uint8_t * buf, - uint64_t wanted, - uint64_t * actual) +static bool smb_write_func(void * handle, uint8_t * buf, uint64_t wanted, + uint64_t * actual) { NTSTATUS ret; union smb_write w; diff --git a/source4/lib/socket_wrapper/socket_wrapper.c b/source4/lib/socket_wrapper/socket_wrapper.c index 8458c615923..c13cb6a3b08 100644 --- a/source4/lib/socket_wrapper/socket_wrapper.c +++ b/source4/lib/socket_wrapper/socket_wrapper.c @@ -232,7 +232,7 @@ const char *socket_wrapper_dir(void) return s; } -static unsigned int socket_wrapper_default_iface(void) +unsigned int socket_wrapper_default_iface(void) { const char *s = getenv("SOCKET_WRAPPER_DEFAULT_IFACE"); if (s) { diff --git a/source4/lib/socket_wrapper/socket_wrapper.h b/source4/lib/socket_wrapper/socket_wrapper.h index fd1e48610b7..cc8b9376086 100644 --- a/source4/lib/socket_wrapper/socket_wrapper.h +++ b/source4/lib/socket_wrapper/socket_wrapper.h @@ -37,6 +37,7 @@ #define __SOCKET_WRAPPER_H__ const char *socket_wrapper_dir(void); +unsigned int socket_wrapper_default_iface(void); int swrap_socket(int family, int type, int protocol); int swrap_accept(int s, struct sockaddr *addr, socklen_t *addrlen); int swrap_connect(int s, const struct sockaddr *serv_addr, socklen_t addrlen); @@ -131,4 +132,5 @@ int swrap_close(int); #define close(s) swrap_close(s) #endif + #endif /* __SOCKET_WRAPPER_H__ */ diff --git a/source4/librpc/tools/ndrdump.c b/source4/librpc/tools/ndrdump.c index bd9d860c84b..5a3e63ed93f 100644 --- a/source4/librpc/tools/ndrdump.c +++ b/source4/librpc/tools/ndrdump.c @@ -87,10 +87,10 @@ static char *stdin_load(TALLOC_CTX *mem_ctx, size_t *size) while((num_read = read(STDIN_FILENO, buf, 255)) > 0) { if (result) { - result = (char *) talloc_realloc( - mem_ctx, result, char *, total_len + num_read); + result = talloc_realloc( + mem_ctx, result, char, total_len + num_read); } else { - result = talloc_size(mem_ctx, num_read); + result = talloc_array(mem_ctx, char, num_read); } memcpy(result + total_len, buf, num_read); @@ -104,7 +104,7 @@ static char *stdin_load(TALLOC_CTX *mem_ctx, size_t *size) return result; } -const struct ndr_interface_table *load_iface_from_plugin(const char *plugin, const char *pipe_name) +static const struct ndr_interface_table *load_iface_from_plugin(const char *plugin, const char *pipe_name) { const struct ndr_interface_table *p; void *handle; @@ -117,7 +117,7 @@ const struct ndr_interface_table *load_iface_from_plugin(const char *plugin, con } symbol = talloc_asprintf(NULL, "ndr_table_%s", pipe_name); - p = dlsym(handle, symbol); + p = (const struct ndr_interface_table *)dlsym(handle, symbol); if (!p) { printf("%s: Unable to find DCE/RPC interface table for '%s': %s\n", plugin, pipe_name, dlerror()); diff --git a/source4/param/config.mk b/source4/param/config.mk index cac95a63ddb..5ed10972960 100644 --- a/source4/param/config.mk +++ b/source4/param/config.mk @@ -46,6 +46,5 @@ PRIVATE_DEPENDENCIES = LIBLDB ################################################ [SUBSYSTEM::SECRETS] -PRIVATE_PROTO_HEADER = secrets_proto.h OBJ_FILES = secrets.o PRIVATE_DEPENDENCIES = DB_WRAP UTIL_TDB diff --git a/source4/param/secrets.h b/source4/param/secrets.h index 44ffdbd8a68..5aabb849c5c 100644 --- a/source4/param/secrets.h +++ b/source4/param/secrets.h @@ -34,6 +34,19 @@ struct machine_acct_pass { #define SECRETS_KRBTGT_SEARCH "(&((|(realm=%s)(flatname=%s))(samAccountName=krbtgt)))" #define SECRETS_PRINCIPAL_SEARCH "(&(|(realm=%s)(flatname=%s))(servicePrincipalName=%s))" -#include "param/secrets_proto.h" +/** + * Use a TDB to store an incrementing random seed. + * + * Initialised to the current pid, the very first time Samba starts, + * and incremented by one each time it is needed. + * + * @note Not called by systems with a working /dev/urandom. + */ +void secrets_shutdown(void); +bool secrets_init(void); +struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx); +struct dom_sid *secrets_get_domain_sid(TALLOC_CTX *mem_ctx, + const char *domain); + #endif /* _SECRETS_H */ diff --git a/source4/rpc_server/service_rpc.c b/source4/rpc_server/service_rpc.c index e9c56b9c171..6875ff88ff9 100644 --- a/source4/rpc_server/service_rpc.c +++ b/source4/rpc_server/service_rpc.c @@ -216,7 +216,7 @@ static const struct stream_server_ops dcesrv_stream_ops = { -NTSTATUS dcesrv_add_ep_unix(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e, +static NTSTATUS dcesrv_add_ep_unix(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e, struct event_context *event_ctx, const struct model_ops *model_ops) { struct dcesrv_socket_context *dcesrv_sock; @@ -241,7 +241,7 @@ NTSTATUS dcesrv_add_ep_unix(struct dcesrv_context *dce_ctx, struct dcesrv_endpoi return status; } -NTSTATUS dcesrv_add_ep_ncalrpc(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e, +static NTSTATUS dcesrv_add_ep_ncalrpc(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e, struct event_context *event_ctx, const struct model_ops *model_ops) { struct dcesrv_socket_context *dcesrv_sock; @@ -309,7 +309,7 @@ static NTSTATUS add_socket_rpc_pipe_iface(struct dcesrv_context *dce_ctx, struct return status; } -NTSTATUS dcesrv_add_ep_np(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e, +static NTSTATUS dcesrv_add_ep_np(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e, struct event_context *event_ctx, const struct model_ops *model_ops) { NTSTATUS status; @@ -356,7 +356,7 @@ static NTSTATUS add_socket_rpc_tcp_iface(struct dcesrv_context *dce_ctx, struct return status; } -NTSTATUS dcesrv_add_ep_tcp(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e, +static NTSTATUS dcesrv_add_ep_tcp(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e, struct event_context *event_ctx, const struct model_ops *model_ops) { NTSTATUS status; @@ -379,7 +379,7 @@ NTSTATUS dcesrv_add_ep_tcp(struct dcesrv_context *dce_ctx, struct dcesrv_endpoin } -NTSTATUS dcesrv_add_ep(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e, +static NTSTATUS dcesrv_add_ep(struct dcesrv_context *dce_ctx, struct dcesrv_endpoint *e, struct event_context *event_ctx, const struct model_ops *model_ops) { switch (e->ep_description->transport) { diff --git a/source4/smbd/pidfile.c b/source4/smbd/pidfile.c index 167555fd28e..57ff68709fc 100644 --- a/source4/smbd/pidfile.c +++ b/source4/smbd/pidfile.c @@ -22,6 +22,7 @@ #include "includes.h" #include "system/filesys.h" #include "param/param.h" +#include "smbd/pidfile.h" /** * @file diff --git a/source4/smbd/server.c b/source4/smbd/server.c index 93f6f03be57..23d996bf2e8 100644 --- a/source4/smbd/server.c +++ b/source4/smbd/server.c @@ -153,7 +153,7 @@ static void setup_signals(void) static void server_stdin_handler(struct event_context *event_ctx, struct fd_event *fde, uint16_t flags, void *private) { - const char *binary_name = private; + const char *binary_name = (const char *)private; uint8_t c; if (read(0, &c, 1) == 0) { DEBUG(0,("%s: EOF on stdin - terminating\n", binary_name)); @@ -169,10 +169,11 @@ static void server_stdin_handler(struct event_context *event_ctx, struct fd_even /* die if the user selected maximum runtime is exceeded */ -_NORETURN_ static void max_runtime_handler(struct event_context *ev, struct timed_event *te, - struct timeval t, void *private) +_NORETURN_ static void max_runtime_handler(struct event_context *ev, + struct timed_event *te, + struct timeval t, void *private) { - const char *binary_name = private; + const char *binary_name = (const char *)private; DEBUG(0,("%s: maximum runtime exceeded - terminating\n", binary_name)); exit(0); }