summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-09-08 13:34:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:05:41 -0500
commit7a287e07043cf937e22f8051c1a324d8a30c53e1 (patch)
treefc71bd59d3ce06427d666e8687f8e981c5d13e8c
parentdccf3f99e45137b6cd18c1de1c79808ad67130d1 (diff)
downloadsamba-7a287e07043cf937e22f8051c1a324d8a30c53e1.tar.gz
samba-7a287e07043cf937e22f8051c1a324d8a30c53e1.tar.bz2
samba-7a287e07043cf937e22f8051c1a324d8a30c53e1.zip
r25028: Fix more warnings.
(This used to be commit 3aa7ee4a0d8837471deeaa1c5a1f4a0d2a14aa6e)
-rw-r--r--source4/client/cifsddio.c14
-rw-r--r--source4/lib/socket_wrapper/socket_wrapper.c2
-rw-r--r--source4/lib/socket_wrapper/socket_wrapper.h2
-rw-r--r--source4/librpc/tools/ndrdump.c10
-rw-r--r--source4/param/config.mk1
-rw-r--r--source4/param/secrets.h15
-rw-r--r--source4/rpc_server/service_rpc.c10
-rw-r--r--source4/smbd/pidfile.c1
-rw-r--r--source4/smbd/server.c9
9 files changed, 38 insertions, 26 deletions
diff --git a/source4/client/cifsddio.c b/source4/client/cifsddio.c
index 7dc9b8d081..8623161752 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 8458c61592..c13cb6a3b0 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 fd1e48610b..cc8b937608 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 bd9d860c84..5a3e63ed93 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 cac95a63dd..5ed1097296 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 44ffdbd8a6..5aabb849c5 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 e9c56b9c17..6875ff88ff 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 167555fd28..57ff68709f 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 93f6f03be5..23d996bf2e 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);
}