r25001: Fix more C++ and other warnings, fix some of the indentation with ts=4 lines...
authorJelmer Vernooij <jelmer@samba.org>
Fri, 7 Sep 2007 15:35:18 +0000 (15:35 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 20:05:28 +0000 (15:05 -0500)
20 files changed:
source/auth/gensec/gensec_gssapi.c
source/client/client.c
source/client/smbmount.c
source/dsdb/samdb/ldb_modules/password_hash.c
source/kdc/kdc.c
source/ldap_server/ldap_server.c
source/lib/registry/patchfile_dotreg.c
source/lib/socket/connect_multi.c
source/lib/tdb/tools/tdbtorture.c
source/libcli/nbt/namerefresh.c
source/libcli/raw/raweas.c
source/libcli/raw/rawlpq.c
source/libcli/raw/smb_signing.c
source/libcli/resolve/resolve.c
source/libcli/resolve/wins.c
source/libnet/libnet_samdump.c
source/libnet/libnet_samsync_ldb.c
source/librpc/rpc/dcerpc_sock.c
source/nbt_server/wins/wins_hook.c
source/winbind/wb_samba3_protocol.c

index 3c66a032d5948089e460e4e5e0a3ac03daac4323..dd9f19ac437298824ecb16108b5ad7235df1daf7 100644 (file)
@@ -1229,7 +1229,9 @@ static NTSTATUS gensec_gssapi_session_info(struct gensec_security *gensec_securi
                return NT_STATUS_FOOBAR;
        }
 
-       principal_string = talloc_strndup(mem_ctx, name_token.value, name_token.length);
+       principal_string = talloc_strndup(mem_ctx, 
+                                         (const char *)name_token.value, 
+                                         name_token.length);
 
        gss_release_buffer(&min_stat, &name_token);
 
index 1fdbec4bfd010f5f90f1bb3e84e30e5a86f9d55b..0a3cb21752adb2f9c3aa555d7505373f27392ea3 100644 (file)
@@ -3045,10 +3045,10 @@ static struct smbclient_context *do_connect(TALLOC_CTX *mem_ctx,
 /****************************************************************************
 handle a -L query
 ****************************************************************************/
-static int do_host_query(const char *query_host)
+static int do_host_query(const char *query_host, const char *workgroup)
 {
        browse_host(query_host);
-       list_servers(lp_workgroup());
+       list_servers(workgroup);
        return(0);
 }
 
@@ -3209,7 +3209,7 @@ static int do_message_op(const char *desthost, const char *destip, int name_type
        }
   
        if (query_host) {
-               return do_host_query(query_host);
+               return do_host_query(query_host, lp_workgroup());
        }
 
        if (message) {
index f15b1f7030ec96fd26a4b09a995674070b2c79a5..7bd42b84cff98e06aedea53e90844008c249a220 100644 (file)
@@ -911,7 +911,7 @@ static void parse_mount_smb(int argc, char **argv)
        DEBUG(3,("mount.smbfs started (version %s)\n", VERSION));
 
        if (*workgroup == 0) {
-               pstrcpy(workgroup,lp_workgroup());
+               pstrcpy(workgroup, lp_workgroup());
        }
 
        if (!*my_netbios_name) {
index 98061570c8ce946384def5901ff14eb2704ba323..a275810b12fcb9709b420c5e6a7c55a8a9d73fc8 100644 (file)
@@ -340,17 +340,17 @@ static int setup_primary_kerberos(struct setup_password_fields_io *io,
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
-if (lp_parm_bool(-1, "password_hash", "create_aes_key", false)) {
-/*
- * TODO:
- *
- * w2k and w2k3 doesn't support AES, so we'll not include
- * the AES key here yet.
- *
- * Also we don't have an example supplementalCredentials blob
- * from Windows Longhorn Server with AES support
- *
- */
+       if (lp_parm_bool(-1, "password_hash", "create_aes_key", false)) {
+       /*
       * TODO:
       *
       * w2k and w2k3 doesn't support AES, so we'll not include
       * the AES key here yet.
       *
       * Also we don't have an example supplementalCredentials blob
       * from Windows Longhorn Server with AES support
       *
       */
        /*
         * create ENCTYPE_AES256_CTS_HMAC_SHA1_96 key out of
         * the salt and the cleartext password
index c58f73824374f00f327bad2a19a3dacee6936722..f26e5a7e9b7490cde38f7d9cdfa1dec4d69bbfe8 100644 (file)
@@ -407,15 +407,14 @@ static const struct stream_server_ops kpasswdd_tcp_stream_ops = {
 /*
   start listening on the given address
 */
-static NTSTATUS kdc_add_socket(struct kdc_server *kdc, const char *address)
+static NTSTATUS kdc_add_socket(struct kdc_server *kdc, const char *address,
+                              uint16_t kdc_port, uint16_t kpasswd_port)
 {
        const struct model_ops *model_ops;
        struct kdc_socket *kdc_socket;
        struct kdc_socket *kpasswd_socket;
        struct socket_address *kdc_address, *kpasswd_address;
        NTSTATUS status;
-       uint16_t kdc_port = lp_krb5_port();
-       uint16_t kpasswd_port = lp_kpasswd_port();
 
        kdc_socket = talloc(kdc, struct kdc_socket);
        NT_STATUS_HAVE_NO_MEMORY(kdc_socket);
@@ -526,7 +525,8 @@ static NTSTATUS kdc_startup_interfaces(struct kdc_server *kdc)
        
        for (i=0; i<num_interfaces; i++) {
                const char *address = talloc_strdup(tmp_ctx, iface_n_ip(i));
-               status = kdc_add_socket(kdc, address);
+               status = kdc_add_socket(kdc, address, lp_krb5_port(), 
+                                       lp_kpasswd_port());
                NT_STATUS_NOT_OK_RETURN(status);
        }
 
index 0de76052d1c3c66398af3c95b19a76f5a1ee5945..2ea1a96ae7b510730bca2f7543bb4dc33c130cd2 100644 (file)
@@ -538,7 +538,8 @@ static void ldapsrv_task_init(struct task_server *task)
                        if (!NT_STATUS_IS_OK(status)) goto failed;
                }
        } else {
-               status = add_socket(task->event_ctx, model_ops, lp_socket_address(), ldap_service);
+               status = add_socket(task->event_ctx, model_ops, 
+                                   lp_socket_address(), ldap_service);
                if (!NT_STATUS_IS_OK(status)) goto failed;
        }
 
index 32b70d214414c96ecc0829dbf2187e646c8a65e0..85cf8ab2519aa744b35fe5bd386ca21837708f2e 100644 (file)
@@ -79,7 +79,7 @@ static WERROR reg_dotreg_diff_del_value(void *_data, const char *path, const cha
 
 static WERROR reg_dotreg_diff_done(void *_data)
 {
-       struct dotreg_data *data = _data;
+       struct dotreg_data *data = (struct dotreg_data *)_data;
 
        close(data->fd);
        talloc_free(data);
index 76e5034a58c787578e648b29937a4f12f0b212b0..6bf7ca4d3e2976cb3e1e7238d16b80893fae6079 100644 (file)
@@ -62,7 +62,8 @@ static void continue_one(struct composite_context *creq);
 /*
   setup an async socket_connect, with multiple ports
 */
-_PUBLIC_ struct composite_context *socket_connect_multi_send(TALLOC_CTX *mem_ctx,
+_PUBLIC_ struct composite_context *socket_connect_multi_send(
+                                                   TALLOC_CTX *mem_ctx,
                                                    const char *server_address,
                                                    int num_server_ports,
                                                    uint16_t *server_ports,
index 14a2b48cdc78d4bf5e4d215b1f2cd354e08312cc..ca71c736ad425a8cebe2264b35826a14443d679f 100644 (file)
@@ -238,7 +238,7 @@ static void usage(void)
 
        unlink("torture.tdb");
 
-       pids = calloc(sizeof(pid_t), num_procs);
+       pids = (pid_t *)calloc(sizeof(pid_t), num_procs);
        pids[0] = getpid();
 
        for (i=0;i<num_procs-1;i++) {
index a60e54ed6aa472d266b43d2dd7d11dd386fe795d..afa80d68f84978a95cc97ccd1e605d0323d4df57 100644 (file)
@@ -66,7 +66,8 @@ struct nbt_name_request *nbt_name_refresh_send(struct nbt_name_socket *nbtsock,
        packet->additional[0].rdata.netbios.addresses[0].ipaddr = 
                talloc_strdup(packet->additional, io->in.address);
 
-       dest = socket_address_from_strings(nbtsock, nbtsock->sock->backend_name, 
+       dest = socket_address_from_strings(nbtsock, 
+                                          nbtsock->sock->backend_name, 
                                           io->in.dest_addr, lp_nbt_port());
        if (dest == NULL) goto failed;
        req = nbt_name_request_send(nbtsock, dest, packet,
index f79de88fa67a1c33f7a58d3a3748f668be121048..06b5b4fc4d43e5d0adbdbdbccb7620c0328dd159 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "includes.h"
 #include "smb.h"
+#include "libcli/raw/libcliraw.h"
 
 /*
   work out how many bytes on the wire a ea list will consume. 
index 03f7a82f1cf451379b8b2d105fbc464baedf72c5..46e0efaaf5c9c5bf5616909c35bab1e9f01f5684 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "includes.h"
 #include "smb.h"
+#include "libcli/raw/libcliraw.h"
 
 /****************************************************************************
  lpq - async send
index 99044d23aec4fad126c860619133350ce6977687..a37c9a7836ed1a545115da71385b150430263118 100644 (file)
@@ -375,7 +375,7 @@ BOOL smbcli_transport_simple_set_signing(struct smbcli_transport *transport,
 }
 
 
-BOOL smbcli_init_signing(struct smbcli_transport *transport) 
+bool smbcli_init_signing(struct smbcli_transport *transport) 
 {
        transport->negotiate.sign_info.mac_key = data_blob(NULL, 0);
        if (!smbcli_set_signing_off(&transport->negotiate.sign_info)) {
index 63598fdd00c253f541114f54325190594946652d..ee9b8df14896f05c1b2fc7ef22c8b2f61c5804df 100644 (file)
@@ -188,7 +188,8 @@ NTSTATUS resolve_name_recv(struct composite_context *c,
 NTSTATUS resolve_name(struct nbt_name *name, TALLOC_CTX *mem_ctx, const char **reply_addr, 
                      struct event_context *ev)
 {
-       struct composite_context *c = resolve_name_send(name, ev, lp_name_resolve_order());
+       struct composite_context *c = resolve_name_send(name, ev, 
+                                               lp_name_resolve_order());
        return resolve_name_recv(c, mem_ctx, reply_addr);
 }
 
index 7af12075a195d9d6ffd9305b109cc76c7ad4a3ee..f7bfdc340500a417004d44ed4c1a98db81212617 100644 (file)
 /*
   wins name resolution method - async send
  */
-struct composite_context *resolve_name_wins_send(TALLOC_CTX *mem_ctx, 
-                                                struct event_context *event_ctx,
-                                                struct nbt_name *name)
+struct composite_context *resolve_name_wins_send(
+                               TALLOC_CTX *mem_ctx, 
+                               struct event_context *event_ctx,
+                               struct nbt_name *name)
 {
        const char **address_list = lp_wins_server_list();
        if (address_list == NULL) return NULL;
index fb4267748a141194b6eeee3755b15598f767a1a6..fc671a9b486925332c287a7830619b73b97f10ec 100644 (file)
@@ -144,7 +144,8 @@ static NTSTATUS libnet_samdump_fn(TALLOC_CTX *mem_ctx,
        return nt_status;
 }
 
-NTSTATUS libnet_SamDump(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, struct libnet_SamDump *r)
+NTSTATUS libnet_SamDump(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, 
+                       struct libnet_SamDump *r)
 {
        NTSTATUS nt_status;
        struct libnet_SamSync r2;
index 338b15d6d72495ea45f29de469f857f44d6808bc..1947eadddcedc3b0626c6130614cdcd0ae7d827a 100644 (file)
@@ -1209,7 +1209,8 @@ NTSTATUS libnet_samsync_ldb(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, str
        state->secrets         = NULL;
        state->trusted_domains = NULL;
 
-       state->sam_ldb         = ldb_wrap_connect(mem_ctx, lp_sam_url(), r->in.session_info,
+       state->sam_ldb         = ldb_wrap_connect(mem_ctx, lp_sam_url(), 
+                                                 r->in.session_info,
                                                  ctx->cred, 0, NULL);
 
        r2.out.error_string    = NULL;
index a28b21b5c351c41c08eb4deaa39875091d20deeb..6b47e439cf4c25f3b46840f838dc3710ff57c0cc 100644 (file)
@@ -477,7 +477,8 @@ struct composite_context* dcerpc_pipe_open_tcp_send(struct dcerpc_connection *co
        s->conn            = conn;
 
        make_nbt_name_server(&name, server);
-       resolve_req = resolve_name_send(&name, c->event_ctx, lp_name_resolve_order());
+       resolve_req = resolve_name_send(&name, c->event_ctx, 
+                                       lp_name_resolve_order());
        composite_continue(c, resolve_req, continue_ip_resolve_name, c);
        return c;
 }
index 15c00881922541e00141feb87742fcc6008ed119..e5d8b39062014910730d7a7c8e81166d77e3e162 100644 (file)
@@ -36,7 +36,8 @@ static const char *wins_hook_action_string(enum wins_hook_action action)
        return "unknown";
 }
 
-void wins_hook(struct winsdb_handle *h, const struct winsdb_record *rec, enum wins_hook_action action)
+void wins_hook(struct winsdb_handle *h, const struct winsdb_record *rec, 
+              enum wins_hook_action action)
 {
        const char *script = lp_wins_hook();
        uint32_t i, length;
index 9bf19ebf6ed68752c30a2198b21d7f0e379c3678..f2c9763670e5d2b0ef2bba57f97c10fe3cede3c6 100644 (file)
@@ -223,8 +223,8 @@ static NTSTATUS wbsrv_samba3_push_reply(struct wbsrv_samba3_call *call, TALLOC_C
        uint8_t *extra_data;
        size_t extra_data_len = 0;
 
-       extra_data = call->response.extra_data.data;
-       if (extra_data) {
+       extra_data = (uint8_t *)call->response.extra_data.data;
+       if (extra_data != NULL) {
                extra_data_len = call->response.length -
                        sizeof(call->response);
        }