summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-12-23 23:22:57 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-12-23 23:22:57 +0100
commitdcc4081f75f0d0c51878385477f7738f49a761dd (patch)
tree45a738b1d23c7e5bd3e415e4d74594fd7dc7732a /source4
parent8df6af213a0ca9a70e30c630970b5e2d2debe821 (diff)
downloadsamba-dcc4081f75f0d0c51878385477f7738f49a761dd.tar.gz
samba-dcc4081f75f0d0c51878385477f7738f49a761dd.tar.bz2
samba-dcc4081f75f0d0c51878385477f7738f49a761dd.zip
Fix more compiler warnings.
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/tls/tls.c20
-rw-r--r--source4/ntvfs/ipc/ipc_rap.c2
-rw-r--r--source4/torture/libnet/libnet_rpc.c26
-rw-r--r--source4/torture/raw/lookuprate.c2
-rw-r--r--source4/torture/raw/tconrate.c1
-rw-r--r--source4/torture/rpc/netlogon.c1
-rw-r--r--source4/torture/rpc/samr.c2
-rw-r--r--source4/torture/rpc/schannel.c10
8 files changed, 30 insertions, 34 deletions
diff --git a/source4/lib/tls/tls.c b/source4/lib/tls/tls.c
index 24e4632a49..d16df25548 100644
--- a/source4/lib/tls/tls.c
+++ b/source4/lib/tls/tls.c
@@ -454,7 +454,7 @@ init_failed:
setup for a new connection
*/
struct socket_context *tls_init_server(struct tls_params *params,
- struct socket_context *socket,
+ struct socket_context *socket_ctx,
struct fd_event *fde,
const char *plain_chars)
{
@@ -463,9 +463,9 @@ struct socket_context *tls_init_server(struct tls_params *params,
struct socket_context *new_sock;
NTSTATUS nt_status;
- nt_status = socket_create_with_ops(socket, &tls_socket_ops, &new_sock,
+ nt_status = socket_create_with_ops(socket_ctx, &tls_socket_ops, &new_sock,
SOCKET_TYPE_STREAM,
- socket->flags | SOCKET_FLAG_ENCRYPT);
+ socket_ctx->flags | SOCKET_FLAG_ENCRYPT);
if (!NT_STATUS_IS_OK(nt_status)) {
return NULL;
}
@@ -475,13 +475,13 @@ struct socket_context *tls_init_server(struct tls_params *params,
return NULL;
}
- tls->socket = socket;
+ tls->socket = socket_ctx;
tls->fde = fde;
if (talloc_reference(tls, fde) == NULL) {
talloc_free(new_sock);
return NULL;
}
- if (talloc_reference(tls, socket) == NULL) {
+ if (talloc_reference(tls, socket_ctx) == NULL) {
talloc_free(new_sock);
return NULL;
}
@@ -534,7 +534,7 @@ failed:
/*
setup for a new client connection
*/
-struct socket_context *tls_init_client(struct socket_context *socket,
+struct socket_context *tls_init_client(struct socket_context *socket_ctx,
struct fd_event *fde,
const char *ca_path)
{
@@ -545,9 +545,9 @@ struct socket_context *tls_init_client(struct socket_context *socket,
struct socket_context *new_sock;
NTSTATUS nt_status;
- nt_status = socket_create_with_ops(socket, &tls_socket_ops, &new_sock,
+ nt_status = socket_create_with_ops(socket_ctx, &tls_socket_ops, &new_sock,
SOCKET_TYPE_STREAM,
- socket->flags | SOCKET_FLAG_ENCRYPT);
+ socket_ctx->flags | SOCKET_FLAG_ENCRYPT);
if (!NT_STATUS_IS_OK(nt_status)) {
return NULL;
}
@@ -555,12 +555,12 @@ struct socket_context *tls_init_client(struct socket_context *socket,
tls = talloc(new_sock, struct tls_context);
if (tls == NULL) return NULL;
- tls->socket = socket;
+ tls->socket = socket_ctx;
tls->fde = fde;
if (talloc_reference(tls, fde) == NULL) {
return NULL;
}
- if (talloc_reference(tls, socket) == NULL) {
+ if (talloc_reference(tls, socket_ctx) == NULL) {
return NULL;
}
new_sock->private_data = tls;
diff --git a/source4/ntvfs/ipc/ipc_rap.c b/source4/ntvfs/ipc/ipc_rap.c
index 4969f1a791..07a8b6d1d6 100644
--- a/source4/ntvfs/ipc/ipc_rap.c
+++ b/source4/ntvfs/ipc/ipc_rap.c
@@ -53,8 +53,6 @@
} while (0)
-#define NERR_Success 0
-#define NERR_badpass 86
#define NERR_notsupported 50
struct rap_string_heap {
diff --git a/source4/torture/libnet/libnet_rpc.c b/source4/torture/libnet/libnet_rpc.c
index f25c1ecc48..0bcfcb6a4c 100644
--- a/source4/torture/libnet/libnet_rpc.c
+++ b/source4/torture/libnet/libnet_rpc.c
@@ -41,11 +41,11 @@ static bool test_connect_service(struct libnet_context *ctx,
bool badcreds, NTSTATUS expected_status)
{
NTSTATUS status;
- struct libnet_RpcConnect connect;
- connect.level = level;
- connect.in.binding = binding_string;
- connect.in.name = hostname;
- connect.in.dcerpc_iface = iface;
+ struct libnet_RpcConnect connect_r;
+ connect_r.level = level;
+ connect_r.in.binding = binding_string;
+ connect_r.in.name = hostname;
+ connect_r.in.dcerpc_iface = iface;
/* if bad credentials are needed, set baduser%badpassword instead
of default commandline-passed credentials */
@@ -54,12 +54,12 @@ static bool test_connect_service(struct libnet_context *ctx,
cli_credentials_set_password(ctx->cred, "badpassword", CRED_SPECIFIED);
}
- status = libnet_RpcConnect(ctx, ctx, &connect);
+ status = libnet_RpcConnect(ctx, ctx, &connect_r);
if (!NT_STATUS_EQUAL(status, expected_status)) {
d_printf("Connecting to rpc service %s on %s.\n\tFAILED. Expected: %s."
"Received: %s\n",
- connect.in.dcerpc_iface->name, connect.in.binding, nt_errstr(expected_status),
+ connect_r.in.dcerpc_iface->name, connect_r.in.binding, nt_errstr(expected_status),
nt_errstr(status));
return false;
@@ -68,15 +68,15 @@ static bool test_connect_service(struct libnet_context *ctx,
d_printf("PASSED. Expected: %s, received: %s\n", nt_errstr(expected_status),
nt_errstr(status));
- if (connect.level == LIBNET_RPC_CONNECT_DC_INFO && NT_STATUS_IS_OK(status)) {
+ if (connect_r.level == LIBNET_RPC_CONNECT_DC_INFO && NT_STATUS_IS_OK(status)) {
d_printf("Domain Controller Info:\n");
- d_printf("\tDomain Name:\t %s\n", connect.out.domain_name);
- d_printf("\tDomain SID:\t %s\n", dom_sid_string(ctx, connect.out.domain_sid));
- d_printf("\tRealm:\t\t %s\n", connect.out.realm);
- d_printf("\tGUID:\t\t %s\n", GUID_string(ctx, connect.out.guid));
+ d_printf("\tDomain Name:\t %s\n", connect_r.out.domain_name);
+ d_printf("\tDomain SID:\t %s\n", dom_sid_string(ctx, connect_r.out.domain_sid));
+ d_printf("\tRealm:\t\t %s\n", connect_r.out.realm);
+ d_printf("\tGUID:\t\t %s\n", GUID_string(ctx, connect_r.out.guid));
} else if (!NT_STATUS_IS_OK(status)) {
- d_printf("Error string: %s\n", connect.out.error_string);
+ d_printf("Error string: %s\n", connect_r.out.error_string);
}
return true;
diff --git a/source4/torture/raw/lookuprate.c b/source4/torture/raw/lookuprate.c
index f7ba004ae5..e4caf7b1be 100644
--- a/source4/torture/raw/lookuprate.c
+++ b/source4/torture/raw/lookuprate.c
@@ -237,7 +237,7 @@ bool torture_bench_lookup(struct torture_context *torture)
NTSTATUS status;
bool result = false;
- int i, tries;
+ int i;
struct smbcli_state *cli = NULL;
if (!torture_open_connection(&cli, torture, 0)) {
diff --git a/source4/torture/raw/tconrate.c b/source4/torture/raw/tconrate.c
index 0109b65481..076e5be31f 100644
--- a/source4/torture/raw/tconrate.c
+++ b/source4/torture/raw/tconrate.c
@@ -29,7 +29,6 @@
#define TIME_LIMIT_SECS 30
#define usec_to_sec(s) ((s) / 1000000)
-#define sec_to_usec(s) ((s) * 1000000)
/* Map a shared memory buffer of at least nelem counters. */
static void * map_count_buffer(unsigned nelem, size_t elemsz)
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index c7518d15a0..785b43d7a1 100644
--- a/source4/torture/rpc/netlogon.c
+++ b/source4/torture/rpc/netlogon.c
@@ -148,7 +148,6 @@ bool test_SetupCredentials2(struct dcerpc_pipe *p, struct torture_context *tctx,
struct creds_CredentialState *creds;
const struct samr_Password *mach_password;
const char *machine_name;
- const char *plain_pass;
mach_password = cli_credentials_get_nt_hash(machine_credentials, tctx);
machine_name = cli_credentials_get_workstation(machine_credentials);
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index 2912628744..821cac341e 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -1087,7 +1087,7 @@ static bool test_SetUserPass_level_ex(struct dcerpc_pipe *p,
}
if (fields_present & SAMR_FIELD_COMMENT) {
- comment = talloc_asprintf(tctx, "comment: %d\n", time(NULL));
+ comment = talloc_asprintf(tctx, "comment: %ld\n", time(NULL));
}
ZERO_STRUCT(u);
diff --git a/source4/torture/rpc/schannel.c b/source4/torture/rpc/schannel.c
index 451990a71b..bc3cbeac3b 100644
--- a/source4/torture/rpc/schannel.c
+++ b/source4/torture/rpc/schannel.c
@@ -129,7 +129,7 @@ static bool test_samr_ops(struct torture_context *tctx,
NTSTATUS status;
struct samr_GetDomPwInfo r;
struct samr_PwInfo info;
- struct samr_Connect connect;
+ struct samr_Connect connect_r;
struct samr_OpenDomain opendom;
int i;
struct lsa_String name;
@@ -140,13 +140,13 @@ static bool test_samr_ops(struct torture_context *tctx,
r.in.domain_name = &name;
r.out.info = &info;
- connect.in.system_name = 0;
- connect.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
- connect.out.connect_handle = &handle;
+ connect_r.in.system_name = 0;
+ connect_r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
+ connect_r.out.connect_handle = &handle;
printf("Testing Connect and OpenDomain on BUILTIN\n");
- status = dcerpc_samr_Connect(p, tctx, &connect);
+ status = dcerpc_samr_Connect(p, tctx, &connect_r);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED)) {
printf("Connect failed (expected, schannel mapped to anonymous): %s\n",