remove compiler warnings and remove a few allow_warnings=True

Stefan (metze) Metzmacher metze at samba.org
Wed Mar 18 16:16:24 MDT 2015


Am 18.03.2015 um 21:35 schrieb Stefan (metze) Metzmacher:
> Hi,
> 
> here're some patches to cleanup compiler warnings
> and remove some allow_warnings=True in server related code.
> 
> Please review and push...

Some more...

metze
-------------- next part --------------
From 742522990a86c99df6b8315e12035c26db760690 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 21:42:19 +0100
Subject: [PATCH 01/22] s4:lib/tls: add tls_cert_generate() prototype to tls.h

This avoids compiler warnings...

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source4/lib/tls/tls.h         | 5 +++++
 source4/lib/tls/tls_tstream.c | 2 --
 source4/lib/tls/tlscert.c     | 1 +
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/source4/lib/tls/tls.h b/source4/lib/tls/tls.h
index ed3c81e..64ab7c2 100644
--- a/source4/lib/tls/tls.h
+++ b/source4/lib/tls/tls.h
@@ -45,6 +45,11 @@ struct socket_context *tls_init_server(struct tls_params *parms,
 				    struct tevent_fd *fde,
 				    const char *plain_chars);
 
+void tls_cert_generate(TALLOC_CTX *mem_ctx,
+		       const char *hostname,
+		       const char *keyfile, const char *certfile,
+		       const char *cafile);
+
 /*
   call tls_init_client() on each new client connection
 */
diff --git a/source4/lib/tls/tls_tstream.c b/source4/lib/tls/tls_tstream.c
index 2cb75ed..f19f5c5 100644
--- a/source4/lib/tls/tls_tstream.c
+++ b/source4/lib/tls/tls_tstream.c
@@ -1066,8 +1066,6 @@ int tstream_tls_connect_recv(struct tevent_req *req,
 	return 0;
 }
 
-extern void tls_cert_generate(TALLOC_CTX *, const char *, const char *, const char *, const char *);
-
 /*
   initialise global tls state
 */
diff --git a/source4/lib/tls/tlscert.c b/source4/lib/tls/tlscert.c
index b44d46b..8eab04a 100644
--- a/source4/lib/tls/tlscert.c
+++ b/source4/lib/tls/tlscert.c
@@ -20,6 +20,7 @@
 */
 
 #include "includes.h"
+#include "lib/tls/tls.h"
 
 #if ENABLE_GNUTLS
 #include <gnutls/gnutls.h>
-- 
1.9.1


From 7c259bc2e8bac6c2444566279093eed363c64e3a Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 21:43:00 +0100
Subject: [PATCH 02/22] s4:lib/tls: remove allow_warnings=True

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source4/lib/tls/wscript | 1 -
 1 file changed, 1 deletion(-)

diff --git a/source4/lib/tls/wscript b/source4/lib/tls/wscript
index 0223d73..83520a7 100644
--- a/source4/lib/tls/wscript
+++ b/source4/lib/tls/wscript
@@ -64,6 +64,5 @@ def configure(conf):
 def build(bld):
     bld.SAMBA_SUBSYSTEM('LIBTLS',
                         source='tls.c tlscert.c tls_tstream.c',
-                        allow_warnings=True,
                         public_deps='talloc gnutls gcrypt samba-hostconfig samba_socket LIBTSOCKET tevent tevent-util'
                         )
-- 
1.9.1


From 1f74389caff0962e66c7e7d73fcb3228bb138b58 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 21:49:05 +0100
Subject: [PATCH 03/22] auth/kerberos: avoid compiler warnings

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 auth/kerberos/gssapi_pac.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/auth/kerberos/gssapi_pac.c b/auth/kerberos/gssapi_pac.c
index 99181a1..c6fa909 100644
--- a/auth/kerberos/gssapi_pac.c
+++ b/auth/kerberos/gssapi_pac.c
@@ -54,7 +54,7 @@ const gss_OID_desc * const gss_mech_krb5_wrong        = krb5_gss_oid_array+2;
 
 gss_OID_desc gse_sesskey_inq_oid = {
 	GSS_KRB5_INQ_SSPI_SESSION_KEY_OID_LENGTH,
-	(void *)GSS_KRB5_INQ_SSPI_SESSION_KEY_OID
+	discard_const(GSS_KRB5_INQ_SSPI_SESSION_KEY_OID)
 };
 
 #ifndef GSS_KRB5_SESSION_KEY_ENCTYPE_OID
@@ -64,7 +64,7 @@ gss_OID_desc gse_sesskey_inq_oid = {
 
 gss_OID_desc gse_sesskeytype_oid = {
 	GSS_KRB5_SESSION_KEY_ENCTYPE_OID_LENGTH,
-	(void *)GSS_KRB5_SESSION_KEY_ENCTYPE_OID
+	discard_const(GSS_KRB5_SESSION_KEY_ENCTYPE_OID)
 };
 
 /* The Heimdal OID for getting the PAC */
@@ -236,7 +236,7 @@ NTSTATUS gssapi_get_session_key(TALLOC_CTX *mem_ctx,
 
 	if (keytype) {
 		int diflen, i;
-		const char *p;
+		const uint8_t *p;
 
 		if (set->count < 2) {
 
@@ -266,7 +266,7 @@ NTSTATUS gssapi_get_session_key(TALLOC_CTX *mem_ctx,
 			gss_maj = gss_release_buffer_set(&gss_min, &set);
 			return NT_STATUS_OK;
 		}
-		p = (uint8_t *)set->elements[1].value + gse_sesskeytype_oid.length;
+		p = (const uint8_t *)set->elements[1].value + gse_sesskeytype_oid.length;
 		diflen = set->elements[1].length - gse_sesskeytype_oid.length;
 		if (diflen <= 0) {
 			gss_maj = gss_release_buffer_set(&gss_min, &set);
@@ -307,9 +307,17 @@ char *gssapi_error_string(TALLOC_CTX *mem_ctx,
 	disp_maj_stat = gss_display_status(&disp_min_stat, maj_stat,
 					   GSS_C_GSS_CODE, mech,
 					   &msg_ctx, &maj_error_message);
+	if (disp_maj_stat != 0) {
+		maj_error_message.value = NULL;
+		maj_error_message.length = 0;
+	}
 	disp_maj_stat = gss_display_status(&disp_min_stat, min_stat,
 					   GSS_C_MECH_CODE, mech,
 					   &msg_ctx, &min_error_message);
+	if (disp_maj_stat != 0) {
+		min_error_message.value = NULL;
+		min_error_message.length = 0;
+	}
 
 	maj_error_string = talloc_strndup(mem_ctx,
 					  (char *)maj_error_message.value,
-- 
1.9.1


From ad04d7469b8e155a44f1a22dda6eb92bb53a6be5 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 21:49:32 +0100
Subject: [PATCH 04/22] auth/kerberos: remove allow_warnings=True

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 auth/kerberos/wscript_build | 1 -
 1 file changed, 1 deletion(-)

diff --git a/auth/kerberos/wscript_build b/auth/kerberos/wscript_build
index 15b4889..97b8879 100755
--- a/auth/kerberos/wscript_build
+++ b/auth/kerberos/wscript_build
@@ -1,5 +1,4 @@
 #!/usr/bin/env python
 bld.SAMBA_SUBSYSTEM('KRB5_PAC',
                     source='gssapi_pac.c kerberos_pac.c',
-                    allow_warnings=True,
                     deps='gssapi_krb5 ndr-krb5pac krb5samba')
-- 
1.9.1


From 78aec46c85b42a04893c5a5263dcdc2887e938a6 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 21:52:12 +0100
Subject: [PATCH 05/22] s4:auth/gensec_gssapi: remove compiler warnings

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source4/auth/gensec/gensec_gssapi.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/source4/auth/gensec/gensec_gssapi.c b/source4/auth/gensec/gensec_gssapi.c
index 59dd434..930911d 100644
--- a/source4/auth/gensec/gensec_gssapi.c
+++ b/source4/auth/gensec/gensec_gssapi.c
@@ -56,24 +56,26 @@ static size_t gensec_gssapi_max_wrapped_size(struct gensec_security *gensec_secu
 
 static int gensec_gssapi_destructor(struct gensec_gssapi_state *gensec_gssapi_state)
 {
-	OM_uint32 maj_stat, min_stat;
-	
+	OM_uint32 min_stat;
+
 	if (gensec_gssapi_state->delegated_cred_handle != GSS_C_NO_CREDENTIAL) {
-		maj_stat = gss_release_cred(&min_stat, 
-					    &gensec_gssapi_state->delegated_cred_handle);
+		gss_release_cred(&min_stat,
+				 &gensec_gssapi_state->delegated_cred_handle);
 	}
 
 	if (gensec_gssapi_state->gssapi_context != GSS_C_NO_CONTEXT) {
-		maj_stat = gss_delete_sec_context (&min_stat,
-						   &gensec_gssapi_state->gssapi_context,
-						   GSS_C_NO_BUFFER);
+		gss_delete_sec_context(&min_stat,
+				       &gensec_gssapi_state->gssapi_context,
+				       GSS_C_NO_BUFFER);
 	}
 
 	if (gensec_gssapi_state->server_name != GSS_C_NO_NAME) {
-		maj_stat = gss_release_name(&min_stat, &gensec_gssapi_state->server_name);
+		gss_release_name(&min_stat,
+				 &gensec_gssapi_state->server_name);
 	}
 	if (gensec_gssapi_state->client_name != GSS_C_NO_NAME) {
-		maj_stat = gss_release_name(&min_stat, &gensec_gssapi_state->client_name);
+		gss_release_name(&min_stat,
+				 &gensec_gssapi_state->client_name);
 	}
 
 	if (gensec_gssapi_state->lucid) {
-- 
1.9.1


From e09b86d70e965dd79987fe69e92e130d24f73b8a Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 21:52:12 +0100
Subject: [PATCH 06/22] s4:auth/gensec_gssapi: remove allow_warnings=True

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source4/auth/gensec/wscript_build | 1 -
 1 file changed, 1 deletion(-)

diff --git a/source4/auth/gensec/wscript_build b/source4/auth/gensec/wscript_build
index 1a44a90..cdf1789 100755
--- a/source4/auth/gensec/wscript_build
+++ b/source4/auth/gensec/wscript_build
@@ -19,7 +19,6 @@ bld.SAMBA_MODULE('gensec_gssapi',
 	source='gensec_gssapi.c',
 	subsystem='gensec',
 	init_function='gensec_gssapi_init',
-	allow_warnings=True,
 	deps='gssapi samba-credentials authkrb5 com_err gensec_util'
 	)
 
-- 
1.9.1


From f09f06fa4a4c38301900bfe5db8074dc41c23f5f Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 22:03:59 +0100
Subject: [PATCH 07/22] s4:auth/gensec_cyrus_sasl: remove compiler warnings

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source4/auth/gensec/cyrus_sasl.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/source4/auth/gensec/cyrus_sasl.c b/source4/auth/gensec/cyrus_sasl.c
index 08dccd6..72acc52 100644
--- a/source4/auth/gensec/cyrus_sasl.c
+++ b/source4/auth/gensec/cyrus_sasl.c
@@ -117,6 +117,8 @@ static int gensec_sasl_dispose(struct gensec_sasl_state *gensec_sasl_state)
 	return SASL_OK;
 }
 
+typedef int (*__gensec_sasl_callback_t)(void);
+
 static NTSTATUS gensec_sasl_client_start(struct gensec_security *gensec_security)
 {
 	struct gensec_sasl_state *gensec_sasl_state;
@@ -137,19 +139,19 @@ static NTSTATUS gensec_sasl_client_start(struct gensec_security *gensec_security
 
 	callbacks = talloc_array(gensec_sasl_state, sasl_callback_t, 5);
 	callbacks[0].id = SASL_CB_USER;
-	callbacks[0].proc = gensec_sasl_get_user;
+	callbacks[0].proc = (__gensec_sasl_callback_t)gensec_sasl_get_user;
 	callbacks[0].context = gensec_security;
 
-	callbacks[1].id =  SASL_CB_AUTHNAME;
-	callbacks[1].proc = gensec_sasl_get_user;
+	callbacks[1].id = SASL_CB_AUTHNAME;
+	callbacks[1].proc = (__gensec_sasl_callback_t)gensec_sasl_get_user;
 	callbacks[1].context = gensec_security;
 
 	callbacks[2].id = SASL_CB_GETREALM;
-	callbacks[2].proc = gensec_sasl_get_realm;
+	callbacks[2].proc = (__gensec_sasl_callback_t)gensec_sasl_get_realm;
 	callbacks[2].context = gensec_security;
 
 	callbacks[3].id = SASL_CB_PASS;
-	callbacks[3].proc = gensec_sasl_get_password;
+	callbacks[3].proc = (__gensec_sasl_callback_t)gensec_sasl_get_password;
 	callbacks[3].context = gensec_security;
 
 	callbacks[4].id = SASL_CB_LIST_END;
@@ -392,12 +394,12 @@ NTSTATUS gensec_sasl_init(void)
 	static const sasl_callback_t callbacks[] = {
 		{ 
 			.id = SASL_CB_LOG,
-			.proc = gensec_sasl_log,
+			.proc = (__gensec_sasl_callback_t)gensec_sasl_log,
 			.context = NULL,
 		},
 		{
 			.id = SASL_CB_LIST_END,
-			.proc = gensec_sasl_log,
+			.proc = NULL,
 			.context = NULL,
 		}
 	};
-- 
1.9.1


From f9e90efccf819d3a3ca566d01323c533e0587eac Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 22:03:59 +0100
Subject: [PATCH 08/22] s4:auth/gensec_cyrus_sasl: allow_warnings=True

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source4/auth/gensec/wscript_build | 1 -
 1 file changed, 1 deletion(-)

diff --git a/source4/auth/gensec/wscript_build b/source4/auth/gensec/wscript_build
index cdf1789..097a740 100755
--- a/source4/auth/gensec/wscript_build
+++ b/source4/auth/gensec/wscript_build
@@ -28,7 +28,6 @@ bld.SAMBA_MODULE('cyrus_sasl',
 	subsystem='gensec',
 	init_function='gensec_sasl_init',
 	deps='samba-credentials sasl2',
-	allow_warnings=True,
 	enabled=bld.CONFIG_SET('HAVE_SASL')
 	)
 
-- 
1.9.1


From 088aeb930437446b7a8863e1f2592f0cce478b0f Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 22:17:06 +0100
Subject: [PATCH 09/22] ldb:tests/samba_module: don't be lazy and use
 ldb_msg_copy_shallow/ldb_build_add_req

If we want to modify the the passed request on its way down the module chain,
we should use the proper way and use ldb_msg_copy_shallow() and ldb_build_add_req().

This way we don't alter the callers const structure.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 lib/ldb/tests/sample_module.c | 47 +++++++++++++++++++++++++++++++------------
 1 file changed, 34 insertions(+), 13 deletions(-)

diff --git a/lib/ldb/tests/sample_module.c b/lib/ldb/tests/sample_module.c
index bee40a5..b84420f 100644
--- a/lib/ldb/tests/sample_module.c
+++ b/lib/ldb/tests/sample_module.c
@@ -22,24 +22,45 @@
 */
 
 #include "replace.h"
-#include "system/filesys.h"
-#include "system/time.h"
 #include "ldb_module.h"
 
 static int sample_add(struct ldb_module *mod, struct ldb_request *req)
 {
-	struct ldb_control *control;
-
-	ldb_msg_add_fmt(req->op.add.message, "touchedBy", "sample");
+	struct ldb_context *ldb = ldb_module_get_ctx(mod);
+	struct ldb_control *control = NULL;
+	struct ldb_message *msg = NULL;
+	struct ldb_request *down_req = NULL;
+	int ret;
 
 	/* check if there's a relax control */
 	control = ldb_request_get_control(req, LDB_CONTROL_RELAX_OID);
-	if (control == NULL) {
-		/* not found go on */
-		return ldb_next_request(mod, req);
-	} else {
+	if (control != NULL) {
 		return LDB_ERR_UNWILLING_TO_PERFORM;
 	}
+
+	msg = ldb_msg_copy_shallow(req, req->op.add.message);
+	if (msg == NULL) {
+		return LDB_ERR_OPERATIONS_ERROR;
+	}
+
+	ret = ldb_msg_add_fmt(msg, "touchedBy", "sample");
+	if (ret != LDB_SUCCESS) {
+		return ret;
+	}
+
+	ret = ldb_build_add_req(&down_req, ldb, req,
+				msg,
+				req->controls,
+				NULL, ldb_op_default_callback,
+				req);
+	if (ret != LDB_SUCCESS) {
+		return ret;
+	}
+
+	talloc_steal(down_req, msg);
+
+	/* go on with the call chain */
+	return ldb_next_request(mod, down_req);
 }
 
 static int sample_modify(struct ldb_module *mod, struct ldb_request *req)
@@ -48,12 +69,12 @@ static int sample_modify(struct ldb_module *mod, struct ldb_request *req)
 
 	/* check if there's a relax control */
 	control = ldb_request_get_control(req, LDB_CONTROL_RELAX_OID);
-	if (control == NULL) {
-		/* not found go on */
-		return ldb_next_request(mod, req);
-	} else {
+	if (control != NULL) {
 		return LDB_ERR_UNWILLING_TO_PERFORM;
 	}
+
+	/* not found go on */
+	return ldb_next_request(mod, req);
 }
 
 
-- 
1.9.1


From 040f78466cda1f610a17d2f16f4c53c4d3121ad4 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 22:17:06 +0100
Subject: [PATCH 10/22] ldb:wscript: remove allow_warnings=True for ldb_sample

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 lib/ldb/wscript | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/ldb/wscript b/lib/ldb/wscript
index 1067a00..886b3e7 100755
--- a/lib/ldb/wscript
+++ b/lib/ldb/wscript
@@ -216,7 +216,6 @@ def build(bld):
                          'tests/sample_module.c',
                          init_function='ldb_sample_init',
                          internal_module=False,
-                         allow_warnings=True,
                          module_init_name='ldb_init_module',
                          deps='ldb',
                          subsystem='ldb')
-- 
1.9.1


From c2f18a1bdcd906a32c870cd848b70f45555dbc5f Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 22:39:11 +0100
Subject: [PATCH 11/22] s4:torture/smb2: avoid compiler warnings

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source4/torture/smb2/dir.c     | 11 ++++++++---
 source4/torture/smb2/notify.c  |  5 +++++
 source4/torture/smb2/oplock.c  |  1 -
 source4/torture/smb2/streams.c |  7 +------
 4 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/source4/torture/smb2/dir.c b/source4/torture/smb2/dir.c
index cf96fee1..2eac680 100644
--- a/source4/torture/smb2/dir.c
+++ b/source4/torture/smb2/dir.c
@@ -55,7 +55,7 @@ static NTSTATUS populate_tree(struct torture_context *tctx,
 	struct smb2_create create;
 	char **strs = NULL;
 	NTSTATUS status;
-	bool ret;
+	bool ret = true;
 	int i;
 
 	smb2_deltree(tree, DNAME);
@@ -94,6 +94,10 @@ static NTSTATUS populate_tree(struct torture_context *tctx,
 		smb2_util_close(tree, create.out.file.handle);
 	}
  done:
+	if (!ret) {
+		return status;
+	}
+
 	return status;
 }
 
@@ -727,6 +731,9 @@ static NTSTATUS multiple_smb2_search(struct smb2_tree *tree,
 		}
 	} while (count != 0);
 done:
+	if (!ret) {
+		return status;
+	}
 	return status;
 }
 
@@ -825,8 +832,6 @@ static bool test_many_files(struct torture_context *tctx,
 
 		for (i=0;i<result.count;i++) {
 			const char *s;
-			enum smb_search_level level;
-			level = RAW_SEARCH_SMB2;
 			s = extract_name(&result.list[i],
 					 search_types[t].level,
 					 compare_data_level);
diff --git a/source4/torture/smb2/notify.c b/source4/torture/smb2/notify.c
index c721d5f..bbdc223 100644
--- a/source4/torture/smb2/notify.c
+++ b/source4/torture/smb2/notify.c
@@ -483,6 +483,11 @@ static struct smb2_handle custom_smb2_create(struct smb2_tree *tree,
 	CHECK_STATUS(status, NT_STATUS_OK);
 	h1 = smb2->out.file.handle;
 done:
+	if (!ret) {
+		h1 = (struct smb2_handle) {
+			.data = { 0 , 0},
+		};
+	}
 	return h1;
 }
 
diff --git a/source4/torture/smb2/oplock.c b/source4/torture/smb2/oplock.c
index be1c5eb..fdd29c3 100644
--- a/source4/torture/smb2/oplock.c
+++ b/source4/torture/smb2/oplock.c
@@ -3002,7 +3002,6 @@ static bool test_smb2_oplock_batch26(struct torture_context *tctx,
         smb2_util_close(tree1, h2);
         smb2_util_close(tree1, h3);
         smb2_util_close(tree1, h);
-done:
         smb2_deltree(tree1, BASEDIR);
         return ret;
 
diff --git a/source4/torture/smb2/streams.c b/source4/torture/smb2/streams.c
index 6077c5b..2db893c 100644
--- a/source4/torture/smb2/streams.c
+++ b/source4/torture/smb2/streams.c
@@ -736,7 +736,7 @@ static bool test_stream_names(struct torture_context *tctx,
 	const char *fname = DNAME "\\stream_names.txt";
 	const char *sname1, *sname1b, *sname1c, *sname1d;
 	const char *sname2, *snamew, *snamew2;
-	const char *snamer1, *snamer2;
+	const char *snamer1;
 	bool ret = true;
 	struct smb2_handle h, h1, h2, h3;
 	int i;
@@ -771,7 +771,6 @@ static bool test_stream_names(struct torture_context *tctx,
 				  "?Stream*");
 	snamer1 = talloc_asprintf(mem_ctx, "%s:%s:$DATA", fname,
 				  "BeforeRename");
-	snamer2 = talloc_asprintf(mem_ctx, "%s:%s:$DATA", fname, "AfterRename");
 
 	/* clean slate ...*/
 	smb2_util_unlink(tree, fname);
@@ -1129,8 +1128,6 @@ done:
 }
 
 #define CHECK_CALL_HANDLE(call, rightstatus) do { \
-	check_handle = true; \
-	call_name = #call; \
 	sfinfo.generic.level = RAW_SFILEINFO_ ## call; \
 	sfinfo.generic.in.file.handle = h1; \
 	status = smb2_setinfo_file(tree, &sfinfo); \
@@ -1166,8 +1163,6 @@ static bool test_stream_rename(struct torture_context *tctx,
 	union smb_setfileinfo sfinfo;
 	bool ret = true;
 	struct smb2_handle h, h1;
-	bool check_handle;
-	const char *call_name;
 
 	sname1 = talloc_asprintf(mem_ctx, "%s:%s", fname, "Stream One");
 	sname2 = talloc_asprintf(mem_ctx, "%s:%s:$DaTa", fname,
-- 
1.9.1


From 3f6ea1a800d004e11f28dbc0dd0cfef00afa33c5 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 22:39:33 +0100
Subject: [PATCH 12/22] s4:torture/smb2: remove allow_warnings=True

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source4/torture/smb2/wscript_build | 1 -
 1 file changed, 1 deletion(-)

diff --git a/source4/torture/smb2/wscript_build b/source4/torture/smb2/wscript_build
index 9ccf85b..3c374bb 100644
--- a/source4/torture/smb2/wscript_build
+++ b/source4/torture/smb2/wscript_build
@@ -5,7 +5,6 @@ bld.SAMBA_MODULE('TORTURE_SMB2',
 	smb2.c durable_open.c durable_v2_open.c oplock.c dir.c lease.c create.c
 	acls.c read.c compound.c streams.c ioctl.c rename.c
 	session.c delete-on-close.c replay.c''',
-	allow_warnings=True,
 	subsystem='smbtorture',
 	deps='LIBCLI_SMB2 POPT_CREDENTIALS torture NDR_IOCTL',
 	internal_module=True,
-- 
1.9.1


From b88263c2942460812a21aa90e8d3983ea299a72c Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 22:45:17 +0100
Subject: [PATCH 13/22] s4:torture/ndr: #if 0 unused code

This avoids compiler warnings, but keep the code arround to be activated later.

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source4/torture/ndr/epmap.c    | 2 ++
 source4/torture/ndr/lsa.c      | 2 ++
 source4/torture/ndr/netlogon.c | 2 ++
 source4/torture/ndr/ntlmssp.c  | 2 ++
 source4/torture/ndr/winreg.c   | 4 ++++
 5 files changed, 12 insertions(+)

diff --git a/source4/torture/ndr/epmap.c b/source4/torture/ndr/epmap.c
index 142e74f..ddc1e74 100644
--- a/source4/torture/ndr/epmap.c
+++ b/source4/torture/ndr/epmap.c
@@ -49,6 +49,7 @@ static bool map_in_check(struct torture_context *tctx,
 	return true;
 }
 
+#if 0
 static const uint8_t map_out_data[] = {
   0x00, 0x00, 0x00, 0x00, 0x18, 0xc3, 0x47, 0xdd, 0xe6, 0x5a, 0x8b, 0x42,
   0xb3, 0xb7, 0xc7, 0x79, 0x7b, 0xf0, 0x45, 0xe0, 0x01, 0x00, 0x00, 0x00,
@@ -65,6 +66,7 @@ static bool map_out_check(struct torture_context *tctx,
 
 	return true;
 }
+#endif
 
 struct torture_suite *ndr_epmap_suite(TALLOC_CTX *ctx)
 {
diff --git a/source4/torture/ndr/lsa.c b/source4/torture/ndr/lsa.c
index 353fecf..c83c524 100644
--- a/source4/torture/ndr/lsa.c
+++ b/source4/torture/ndr/lsa.c
@@ -1745,6 +1745,7 @@ static bool lsarlookupsids3_in_check(struct torture_context *tctx,
 	return true;
 }
 
+#if 0
 static const uint8_t lsarlookupsids3_out_data[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x07, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0xc0
@@ -1770,6 +1771,7 @@ static bool lsarlookupsids3_out_check(struct torture_context *tctx,
 
 	return true;
 }
+#endif
 
 static const uint8_t lsarenumerateprivileges_in_data[] = {
   0x00, 0x00, 0x00, 0x00, 0x2a, 0xab, 0xb8, 0x84, 0x36, 0xc6, 0xed, 0x4f,
diff --git a/source4/torture/ndr/netlogon.c b/source4/torture/ndr/netlogon.c
index c7d53db..2e20ff7 100644
--- a/source4/torture/ndr/netlogon.c
+++ b/source4/torture/ndr/netlogon.c
@@ -169,6 +169,7 @@ static bool netrlogonsamlogon_w2k_in_check(struct torture_context *tctx,
 	return true;
 }
 
+#if 0
 static const uint8_t netrlogonsamlogon_w2k_out_data[] = {
 	0x6c, 0xdb, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 	0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
@@ -189,6 +190,7 @@ static bool netrlogonsamlogon_w2k_out_check(struct torture_context *tctx,
 
 	return true;
 }
+#endif
 
 struct torture_suite *ndr_netlogon_suite(TALLOC_CTX *ctx)
 {
diff --git a/source4/torture/ndr/ntlmssp.c b/source4/torture/ndr/ntlmssp.c
index a3cf7b8..36127ce 100644
--- a/source4/torture/ndr/ntlmssp.c
+++ b/source4/torture/ndr/ntlmssp.c
@@ -36,6 +36,7 @@ static bool ntlmssp_NEGOTIATE_MESSAGE_check(struct torture_context *tctx,
 	return true;
 }
 
+#if 0
 static const uint8_t ntlmssp_CHALLENGE_MESSAGE_data[] = {
 	0x4e, 0x54, 0x4c, 0x4d, 0x53, 0x53, 0x50, 0x00, 0x02, 0x00, 0x00, 0x00,
 	0x0a, 0x00, 0x0a, 0x00, 0x38, 0x00, 0x00, 0x00, 0x95, 0x82, 0x89, 0xe2,
@@ -107,6 +108,7 @@ static bool ntlmssp_AUTHENTICATE_MESSAGE_check(struct torture_context *tctx,
 {
 	return true;
 }
+#endif
 
 struct torture_suite *ndr_ntlmssp_suite(TALLOC_CTX *ctx)
 {
diff --git a/source4/torture/ndr/winreg.c b/source4/torture/ndr/winreg.c
index 08c2a05..d77cdb3 100644
--- a/source4/torture/ndr/winreg.c
+++ b/source4/torture/ndr/winreg.c
@@ -441,6 +441,7 @@ static bool queryinfokey_in_check(struct torture_context *tctx, struct winreg_Qu
 	return true;
 }
 
+#if 0
 static const uint8_t queryinfokey_out_data[] = {
   0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
   0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -459,6 +460,7 @@ static bool queryinfokey_out_check(struct torture_context *tctx, struct winreg_Q
 	torture_assert_werr_ok(tctx, r->out.result, "return code");
 	return true;
 }
+#endif
 
 static const uint8_t notifychangekeyvalue_in_data[] = {
   0x00, 0x00, 0x00, 0x00, 0xb2, 0x64, 0xbc, 0xb3, 0x7f, 0x90, 0x29, 0x4a,
@@ -489,6 +491,7 @@ static bool notifychangekeyvalue_out_check(struct torture_context *tctx, struct
 	return true;
 }
 
+#if 0
 static const uint8_t getkeysecurity_in_data[] = {
   0x00, 0x00, 0x00, 0x00, 0xbd, 0xaa, 0xf6, 0x59, 0xc1, 0x82, 0x1f, 0x4d,
   0x84, 0xa9, 0xdd, 0xae, 0x60, 0x77, 0x1e, 0x45, 0x00, 0x00, 0x00, 0x02,
@@ -521,6 +524,7 @@ static bool getkeysecurity_out_check(struct torture_context *tctx,
 	torture_assert_werr_ok(tctx, r->out.result, "return code");
 	return true;
 }
+#endif
 
 static const uint8_t enumkey_in_data[] = {
   0x00, 0x00, 0x00, 0x00, 0x85, 0xb8, 0x41, 0xb0, 0x17, 0xe4, 0x28, 0x45,
-- 
1.9.1


From 43fef4425d519b10c18ed6f453e0063a0f4fbd0f Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 22:46:13 +0100
Subject: [PATCH 14/22] s4:torture/wscript_build: remove allow_warnings=True
 for TORTURE_NDR

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source4/torture/wscript_build | 1 -
 1 file changed, 1 deletion(-)

diff --git a/source4/torture/wscript_build b/source4/torture/wscript_build
index 21e2532..1d88a72 100755
--- a/source4/torture/wscript_build
+++ b/source4/torture/wscript_build
@@ -42,7 +42,6 @@ if bld.CONFIG_SET('AD_DC_BUILD_IS_ENABLED'):
 
 bld.SAMBA_SUBSYSTEM('TORTURE_NDR',
 	source='ndr/ndr.c ndr/winreg.c ndr/atsvc.c ndr/lsa.c ndr/epmap.c ndr/dfs.c ndr/netlogon.c ndr/drsuapi.c ndr/spoolss.c ndr/ntprinting.c ndr/samr.c ndr/dfsblob.c ndr/drsblobs.c ndr/nbt.c ndr/ntlmssp.c ndr/string.c ndr/backupkey.c',
-	allow_warnings=True,
 	autoproto='ndr/proto.h',
 	deps='torture'
 	)
-- 
1.9.1


From c05d85ee7d961b1a978288d5bcbfdb98ed00db3c Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 22:52:32 +0100
Subject: [PATCH 15/22] s4:torture/raw: avoid compiler warnings

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source4/torture/raw/samba3misc.c |  2 --
 source4/torture/raw/search.c     | 11 +++++++----
 source4/torture/raw/streams.c    |  9 +--------
 3 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/source4/torture/raw/samba3misc.c b/source4/torture/raw/samba3misc.c
index a818c6b..95a8229 100644
--- a/source4/torture/raw/samba3misc.c
+++ b/source4/torture/raw/samba3misc.c
@@ -981,7 +981,6 @@ bool torture_samba3_rootdirfid(struct torture_context *tctx, struct smbcli_state
 
 bool torture_samba3_oplock_logoff(struct torture_context *tctx, struct smbcli_state *cli)
 {
-	uint16_t fnum1;
 	union smb_open io;
 	const char *fname = "testfile";
 	bool ret = false;
@@ -1007,7 +1006,6 @@ bool torture_samba3_oplock_logoff(struct torture_context *tctx, struct smbcli_st
 	torture_assert_ntstatus_equal_goto(tctx, smb_raw_open(cli->tree, tctx, &io),
 					   NT_STATUS_OK,
 					   ret, done, "first smb_open on the file failed");
-	fnum1 = io.ntcreatex.out.file.fnum;
 
 	/*
 	 * Create a conflicting open, causing the one-second delay
diff --git a/source4/torture/raw/search.c b/source4/torture/raw/search.c
index 0736c41..924c7f2 100644
--- a/source4/torture/raw/search.c
+++ b/source4/torture/raw/search.c
@@ -35,14 +35,17 @@
 			NT_STATUS_NOT_SUPPORTED) ||			\
 		    NT_STATUS_EQUAL(__status,				\
 			NT_STATUS_NOT_IMPLEMENTED)) {			\
-			torture_warning(__tctx, "(%s) Info "		\
-			    "level "#__level" is %s",			\
-			    __location__, nt_errstr(__status));		\
 			__supp = false;					\
 		} else {						\
+			__supp = true;					\
+		}							\
+		if (__supp) {						\
 			torture_assert_ntstatus_ok_goto(__tctx,		\
 			    __status, ret, done, #__level" failed");	\
-			__supp = true;					\
+		} else {						\
+			torture_warning(__tctx, "(%s) Info "		\
+			    "level "#__level" is %s",			\
+			    __location__, nt_errstr(__status));		\
 		}							\
 	} while (0)
 
diff --git a/source4/torture/raw/streams.c b/source4/torture/raw/streams.c
index c1e502f..103a2c3 100644
--- a/source4/torture/raw/streams.c
+++ b/source4/torture/raw/streams.c
@@ -655,7 +655,7 @@ static bool test_stream_names(struct torture_context *tctx,
 	const char *fname = BASEDIR "\\stream_names.txt";
 	const char *sname1, *sname1b, *sname1c, *sname1d;
 	const char *sname2, *snamew, *snamew2;
-	const char *snamer1, *snamer2;
+	const char *snamer1;
 	bool ret = true;
 	int fnum1 = -1;
 	int fnum2 = -1;
@@ -692,7 +692,6 @@ static bool test_stream_names(struct torture_context *tctx,
 	snamew = talloc_asprintf(tctx, "%s:%s:$DATA", fname, "?Stream*");
 	snamew2 = talloc_asprintf(tctx, "%s\\stream*:%s:$DATA", BASEDIR, "?Stream*");
 	snamer1 = talloc_asprintf(tctx, "%s:%s:$DATA", fname, "BeforeRename");
-	snamer2 = talloc_asprintf(tctx, "%s:%s:$DATA", fname, "AfterRename");
 
 	printf("(%s) testing stream names\n", __location__);
 	io.generic.level = RAW_OPEN_NTCREATEX;
@@ -1090,8 +1089,6 @@ done:
 }
 
 #define CHECK_CALL_FNUM(call, rightstatus) do { \
-        check_fnum = true; \
-        call_name = #call; \
         sfinfo.generic.level = RAW_SFILEINFO_ ## call; \
         sfinfo.generic.in.file.fnum = fnum; \
         status = smb_raw_setfileinfo(cli->tree, &sfinfo); \
@@ -1122,8 +1119,6 @@ static bool test_stream_rename(struct torture_context *tctx,
 	union smb_setfileinfo sfinfo;
 	bool ret = true;
 	int fnum = -1;
-	bool check_fnum;
-	const char *call_name;
 
 	torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
 
@@ -1398,8 +1393,6 @@ static bool test_stream_rename3(struct torture_context *tctx,
 	bool ret = true;
 	int fnum = -1;
 	int fnum2 = -1;
-	bool check_fnum;
-	const char *call_name;
 
 	torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR);
 
-- 
1.9.1


From bf50429726e034dc718a60147af813e81aa372af Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 22:53:00 +0100
Subject: [PATCH 16/22] s4:torture/wscript_build: remove allow_warnings=True
 for TORTURE_RAW

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source4/torture/wscript_build | 1 -
 1 file changed, 1 deletion(-)

diff --git a/source4/torture/wscript_build b/source4/torture/wscript_build
index 1d88a72..1096993 100755
--- a/source4/torture/wscript_build
+++ b/source4/torture/wscript_build
@@ -20,7 +20,6 @@ bld.SAMBA_MODULE('TORTURE_BASIC',
 
 bld.SAMBA_MODULE('TORTURE_RAW',
 	source='raw/qfsinfo.c raw/qfileinfo.c raw/setfileinfo.c raw/search.c raw/close.c raw/open.c raw/mkdir.c raw/oplock.c raw/notify.c raw/mux.c raw/ioctl.c raw/chkpath.c raw/unlink.c raw/read.c raw/context.c raw/session.c raw/write.c raw/lock.c raw/pingpong.c raw/lockbench.c raw/lookuprate.c raw/tconrate.c raw/openbench.c raw/rename.c raw/eas.c raw/streams.c raw/acls.c raw/seek.c raw/samba3hide.c raw/samba3misc.c raw/composite.c raw/raw.c raw/offline.c',
-	allow_warnings=True,
 	autoproto='raw/proto.h',
 	subsystem='smbtorture',
 	init_function='torture_raw_init',
-- 
1.9.1


From 8dffcbed9e9bc865a1e4a26adbdc41efe16bf516 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 23:03:48 +0100
Subject: [PATCH 17/22] s4:torture/rpc: avoid compiler warnings

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source4/torture/rpc/samlogon.c | 14 +++++++-------
 source4/torture/rpc/schannel.c |  3 ++-
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/source4/torture/rpc/samlogon.c b/source4/torture/rpc/samlogon.c
index 3c5398d..11e5e6b 100644
--- a/source4/torture/rpc/samlogon.c
+++ b/source4/torture/rpc/samlogon.c
@@ -1649,9 +1649,9 @@ bool torture_rpc_samlogon(struct torture_context *torture)
 	bool ret = true;
 	struct test_join *join_ctx = NULL;
 	struct test_join *user_ctx = NULL, *user_ctx_wrong_wks = NULL, *user_ctx_wrong_time = NULL;
-	char *user_password, *user_password_wrong_wks, *user_password_wrong_time;
+	const char *user_password, *user_password_wrong_wks, *user_password_wrong_time;
+	char *pw = NULL;
 	const char *old_user_password;
-	char *test_machine_account;
 	const char *userdomain;
 	struct samr_SetUserInfo s;
 	union samr_UserInfo u;
@@ -1672,7 +1672,6 @@ bool torture_rpc_samlogon(struct torture_context *torture)
 	torture_assert(torture, handle_minPwdAge(torture, mem_ctx, true),
 		       "handle_minPwdAge error!");
 
-	test_machine_account = talloc_asprintf(mem_ctx, "%s$", TEST_MACHINE_NAME);
 	/* We only need to join as a workstation here, and in future,
 	 * if we wish to test against trusted domains, we must be a
 	 * workstation here */
@@ -1686,21 +1685,22 @@ bool torture_rpc_samlogon(struct torture_context *torture)
 					   TEST_USER_NAME,
 					   userdomain,
 					   ACB_NORMAL,
-					   (const char **)&user_password);
+					   &user_password);
 	torture_assert(torture, user_ctx, "Failed to create a test user\n");
 
 	old_user_password = user_password;
 
 	tmp_p = torture_join_samr_pipe(user_ctx);
 	test_ChangePasswordUser3(tmp_p, torture,
-				 TEST_USER_NAME, 16 /* > 14 */, &user_password,
+				 TEST_USER_NAME, 16 /* > 14 */, &pw,
 				 NULL, 0, false);
+	user_password = pw;
 
 	user_ctx_wrong_wks = torture_create_testuser(torture,
 						     TEST_USER_NAME_WRONG_WKS,
 					   userdomain,
 					   ACB_NORMAL,
-					   (const char **)&user_password_wrong_wks);
+					   &user_password_wrong_wks);
 	torture_assert(torture, user_ctx_wrong_wks,
 		"Failed to create a test user (wrong workstation test)\n");
 
@@ -1723,7 +1723,7 @@ bool torture_rpc_samlogon(struct torture_context *torture)
 		= torture_create_testuser(torture, TEST_USER_NAME_WRONG_TIME,
 					   userdomain,
 					   ACB_NORMAL,
-					   (const char **)&user_password_wrong_time);
+					   &user_password_wrong_time);
 	torture_assert(torture, user_ctx_wrong_time,
 		"Failed to create a test user (wrong workstation test)\n");
 
diff --git a/source4/torture/rpc/schannel.c b/source4/torture/rpc/schannel.c
index b5a76ec..fb8af5f 100644
--- a/source4/torture/rpc/schannel.c
+++ b/source4/torture/rpc/schannel.c
@@ -554,7 +554,6 @@ static bool test_schannel_anonymous_setPassword(struct torture_context *tctx,
 						uint32_t dcerpc_flags,
 						bool use2)
 {
-	struct test_join *join_ctx;
 	NTSTATUS status, result;
 	const char *binding = torture_setting_string(tctx, "binding", NULL);
 	struct dcerpc_binding *b;
@@ -790,6 +789,7 @@ struct torture_schannel_bench {
 	bool stopped;
 };
 
+#if 0
 static void torture_schannel_bench_connected(struct composite_context *c)
 {
 	struct torture_schannel_bench_conn *conn =
@@ -803,6 +803,7 @@ static void torture_schannel_bench_connected(struct composite_context *c)
 		s->nconns++;
 	}
 }
+#endif
 
 static void torture_schannel_bench_recv(struct tevent_req *subreq);
 
-- 
1.9.1


From 2b9d5335d9a845c70517fbb0ed6077b582403b42 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 23:04:09 +0100
Subject: [PATCH 18/22] s4:torture/wscript_build: remove allow_warnings=True
 for torture_rpc

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source4/torture/wscript_build | 1 -
 1 file changed, 1 deletion(-)

diff --git a/source4/torture/wscript_build b/source4/torture/wscript_build
index 1096993..a1275f2 100755
--- a/source4/torture/wscript_build
+++ b/source4/torture/wscript_build
@@ -48,7 +48,6 @@ bld.SAMBA_SUBSYSTEM('TORTURE_NDR',
 
 bld.SAMBA_MODULE('torture_rpc',
 	source='rpc/join.c rpc/lsa.c rpc/forest_trust.c rpc/lsa_lookup.c rpc/session_key.c rpc/echo.c rpc/dfs.c rpc/drsuapi.c rpc/drsuapi_cracknames.c rpc/dsgetinfo.c rpc/spoolss.c rpc/spoolss_win.c rpc/spoolss_access.c rpc/unixinfo.c rpc/samr.c rpc/samr_accessmask.c rpc/samr_priv.c rpc/wkssvc.c rpc/srvsvc.c rpc/svcctl.c rpc/atsvc.c rpc/eventlog.c rpc/epmapper.c rpc/winreg.c rpc/initshutdown.c rpc/oxidresolve.c rpc/remact.c rpc/mgmt.c rpc/scanner.c rpc/autoidl.c rpc/countcalls.c rpc/testjoin.c rpc/schannel.c rpc/netlogon.c rpc/remote_pac.c rpc/samlogon.c rpc/samsync.c rpc/dssetup.c rpc/alter_context.c rpc/bench.c rpc/samba3rpc.c rpc/rpc.c rpc/async_bind.c rpc/handles.c rpc/frsapi.c rpc/object_uuid.c rpc/ntsvcs.c rpc/browser.c rpc/bind.c rpc/fsrvp.c rpc/clusapi.c '+heimdal_specific['rpc'][0],
-	allow_warnings=True,
 	autoproto='rpc/proto.h',
 	subsystem='smbtorture',
 	init_function='torture_rpc_init',
-- 
1.9.1


From c1b97c2dc9d892e96c28c549cae79ab8804bf811 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 23:08:02 +0100
Subject: [PATCH 19/22] s4:torture/winbind: avoid compiler warnings

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source4/torture/winbind/struct_based.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/source4/torture/winbind/struct_based.c b/source4/torture/winbind/struct_based.c
index 4d46693..76e448c 100644
--- a/source4/torture/winbind/struct_based.c
+++ b/source4/torture/winbind/struct_based.c
@@ -974,7 +974,7 @@ static bool lookup_name_sid_list(struct torture_context *torture, char **list)
 	return true;
 }
 
-static bool name_is_in_list(const char *name, const char **list)
+static bool name_is_in_list(const char *name, char **list)
 {
 	uint32_t count;
 
@@ -1038,8 +1038,8 @@ static bool torture_winbind_struct_lookup_name_sid(struct torture_context *tortu
 		invalid_name = talloc_asprintf(torture, "%s/%s%u",
 					       domain,
 					       invalid_user, count);
-	} while(name_is_in_list(invalid_name, (const char **)users) ||
-		name_is_in_list(invalid_name, (const char **)groups));
+	} while(name_is_in_list(invalid_name, users) ||
+		name_is_in_list(invalid_name, groups));
 
 	fstrcpy(req.data.name.dom_name, domain);
 	fstrcpy(req.data.name.name,
-- 
1.9.1


From f68f0f64fc8c7fbc5ae2675f841ed77f5a62b6ba Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 23:08:33 +0100
Subject: [PATCH 20/22] s4:torture/winbind: remove allow_warnings=True

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source4/torture/winbind/wscript_build | 1 -
 1 file changed, 1 deletion(-)

diff --git a/source4/torture/winbind/wscript_build b/source4/torture/winbind/wscript_build
index 0def23e..447a9f8 100644
--- a/source4/torture/winbind/wscript_build
+++ b/source4/torture/winbind/wscript_build
@@ -2,7 +2,6 @@
 
 bld.SAMBA_MODULE('TORTURE_WINBIND',
 	source='winbind.c struct_based.c ../../../nsswitch/libwbclient/tests/wbclient.c',
-	allow_warnings=True,
 	autoproto='proto.h',
 	subsystem='smbtorture',
 	init_function='torture_winbind_init',
-- 
1.9.1


From 7c9c5453eeb681eb232d200923c94ec0748cd22c Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 23:10:01 +0100
Subject: [PATCH 21/22] s4:torture/libnetapi: avoid compiler warning

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source4/torture/libnetapi/libnetapi_group.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source4/torture/libnetapi/libnetapi_group.c b/source4/torture/libnetapi/libnetapi_group.c
index 6f1428d..d27a99b 100644
--- a/source4/torture/libnetapi/libnetapi_group.c
+++ b/source4/torture/libnetapi/libnetapi_group.c
@@ -361,7 +361,7 @@ bool torture_libnetapi_group(struct torture_context *tctx)
 	torture_comment(tctx, "Testing NetGroupSetInfo level 0\n");
 
 	status = NetGroupSetInfo(hostname, groupname, 0, (uint8_t *)&g0, &parm_err);
-	switch (status) {
+	switch ((uint32_t)status) {
 		case 0:
 			break;
 		case 50: /* not supported */
-- 
1.9.1


From a97b5c673e2ea115c02971957671c23c07e0a575 Mon Sep 17 00:00:00 2001
From: Stefan Metzmacher <metze at samba.org>
Date: Wed, 18 Mar 2015 23:10:26 +0100
Subject: [PATCH 22/22] s4:torture/libnetapi: remove allow_warnings=True

Signed-off-by: Stefan Metzmacher <metze at samba.org>
---
 source4/torture/libnetapi/wscript_build | 1 -
 1 file changed, 1 deletion(-)

diff --git a/source4/torture/libnetapi/wscript_build b/source4/torture/libnetapi/wscript_build
index 017a163..4f579c9 100644
--- a/source4/torture/libnetapi/wscript_build
+++ b/source4/torture/libnetapi/wscript_build
@@ -2,7 +2,6 @@
 
 bld.SAMBA_MODULE('TORTURE_LIBNETAPI',
 	source='libnetapi.c libnetapi_user.c libnetapi_group.c libnetapi_server.c',
-	allow_warnings=True,
 	autoproto='proto.h',
 	subsystem='smbtorture',
 	init_function='torture_libnetapi_init',
-- 
1.9.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150318/4e34a8c6/attachment.pgp>


More information about the samba-technical mailing list