r25028: Fix more warnings.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 8 Sep 2007 13:34:42 +0000 (13:34 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 20:05:41 +0000 (15:05 -0500)
source/client/cifsddio.c
source/lib/socket_wrapper/socket_wrapper.c
source/lib/socket_wrapper/socket_wrapper.h
source/librpc/tools/ndrdump.c
source/param/config.mk
source/param/secrets.h
source/rpc_server/service_rpc.c
source/smbd/pidfile.c
source/smbd/server.c

index 7dc9b8d081ba5933a8bdfb0273c4a9e6ff2f9a3b..862316175207097207cf7cddfa05ff2240ea366d 100644 (file)
@@ -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;
index 8458c6159232618c9af04fcb0078abab991acc88..c13cb6a3b08ef05b54987cb2b71ed89b5af1edf1 100644 (file)
@@ -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) {
index fd1e48610b7937dd5b1898958fa05797cfce5bcb..cc8b93760864d69db27ec7f02f2303283b721c94 100644 (file)
@@ -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__ */
index bd9d860c84b0022c51af81968682b615ecbad182..5a3e63ed93f74325e00c2a62176c5f6fcef97f32 100644 (file)
@@ -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());
index cac95a63ddb8461fc9f1cd2625cd3a00f282c297..5ed10972960ed63e12b19ac7dc54ba67ebb43205 100644 (file)
@@ -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
index 44ffdbd8a68d2c86c16323d091352470e03522d3..5aabb849c5c1482549387671fb7f587ec804c2db 100644 (file)
@@ -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 */
index e9c56b9c171b690f3528a8cbb0e49e76324b6d41..6875ff88ff94cf8470ed0cfd68ed58a786db8a36 100644 (file)
@@ -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) {
index 167555fd28e45e55b0d5c120fdbdf42e110f5a47..57ff68709fc1886dd67555aba9f4a4fedbf5b197 100644 (file)
@@ -22,6 +22,7 @@
 #include "includes.h"
 #include "system/filesys.h"
 #include "param/param.h"
+#include "smbd/pidfile.h"
 
 /**
  * @file
index 93f6f03be57e98404518083c9d95e6ce2bf304bc..23d996bf2e8e972fed48afcfd21a994e69bba693 100644 (file)
@@ -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);
 }