[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Sat Jan 19 14:37:02 UTC 2019


The branch, master has been updated
       via  448d67bae72 s4:kdc: Fix size type for num_bind in kdc-heimdal
       via  c195134e355 s4:dsdb: Fix size type for num_of_attrs in acl_read
       via  9ac30e77f3d s4:dsdb: Fix size types in audit_log
       via  56bbfd90c41 lib:mscat: Use size_t for len value to fix build issue
       via  f3c30b2f8cd lib:mscat: Fix may be used uninitialized warnings
       via  5822449a734 s3:lib: Fix the debug message for adding cache entries.
      from  4b26ccff859 python: dsal: Fix possibility of identical ACE's being added.

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 448d67bae7201523f971f02d2f8578752cd83706
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jan 18 19:09:12 2019 +0100

    s4:kdc: Fix size type for num_bind in kdc-heimdal
    
    This fixes a compile error on sn-devel184.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Sat Jan 19 15:36:51 CET 2019 on sn-devel-144

commit c195134e3550530d3abb3012d3b63860bb872c85
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jan 18 17:50:56 2019 +0100

    s4:dsdb: Fix size type for num_of_attrs in acl_read
    
    This fixes a compile error on sn-devel184.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>

commit 9ac30e77f3d0570ca0adca79be8608e0dc2fa7c2
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jan 18 16:16:05 2019 +0100

    s4:dsdb: Fix size types in audit_log
    
    audit_log.c:878:7: error: assuming signed overflow does not occur when
    simplifying conditional to constant [-Werror=strict-overflow]
    
    Signed-off-by: Andreas Schneider <asn at samba.org>

commit 56bbfd90c4188e5f1fe560eafaf30334f9afccbf
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jan 18 15:28:54 2019 +0100

    lib:mscat: Use size_t for len value to fix build issue
    
    asn1_read_value_type() only uses it as an unsigned it, a negative value
    isn't assinged.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>

commit f3c30b2f8cd39b9eaf5ff7ba0d3c96669e8ade37
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Jan 18 13:11:38 2019 +0100

    lib:mscat: Fix may be used uninitialized warnings
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit 5822449a7340f53987ce4c04851652427f5b49e8
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Jan 17 13:58:14 2019 +0100

    s3:lib: Fix the debug message for adding cache entries.
    
    To get correct values, we need to cast 'timeout' to 'long int' first in
    order to do calculation in that integer space! Calculations are don in
    the space of the lvalue!
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 lib/mscat/mscat_ctl.c                      |  9 ++++++---
 lib/mscat/mscat_pkcs7.c                    |  8 ++++++--
 source3/lib/gencache.c                     |  8 ++++----
 source4/dsdb/samdb/ldb_modules/acl_read.c  |  3 ++-
 source4/dsdb/samdb/ldb_modules/audit_log.c | 10 +++++-----
 source4/kdc/kdc-heimdal.c                  |  2 +-
 6 files changed, 24 insertions(+), 16 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/mscat/mscat_ctl.c b/lib/mscat/mscat_ctl.c
index 972922c4f75..20147a32c35 100644
--- a/lib/mscat/mscat_ctl.c
+++ b/lib/mscat/mscat_ctl.c
@@ -94,13 +94,15 @@ static int mscat_asn1_read_value(TALLOC_CTX *mem_ctx,
 {
 	DATA_BLOB tmp = data_blob_null;
 	unsigned int etype = ASN1_ETYPE_INVALID;
-	int len = 0;
+	int tmp_len = 0;
+	size_t len;
 	int rc;
 
-	rc = asn1_read_value_type(root, name, NULL, &len, &etype);
+	rc = asn1_read_value_type(root, name, NULL, &tmp_len, &etype);
 	if (rc != ASN1_SUCCESS) {
 		return rc;
 	}
+	len = tmp_len;
 
 	if (etype == ASN1_ETYPE_BIT_STRING) {
 		if (len + 7 < len) {
@@ -125,11 +127,12 @@ static int mscat_asn1_read_value(TALLOC_CTX *mem_ctx,
 	rc = asn1_read_value(root,
 			     name,
 			     tmp.data,
-			     &len);
+			     &tmp_len);
 	if (rc != ASN1_SUCCESS) {
 		data_blob_free(&tmp);
 		return rc;
 	}
+	len = tmp_len;
 
 	if (etype == ASN1_ETYPE_BIT_STRING) {
 		if (len + 7 < len) {
diff --git a/lib/mscat/mscat_pkcs7.c b/lib/mscat/mscat_pkcs7.c
index 55944232205..d606a86f095 100644
--- a/lib/mscat/mscat_pkcs7.c
+++ b/lib/mscat/mscat_pkcs7.c
@@ -121,7 +121,9 @@ int mscat_pkcs7_import_catfile(struct mscat_pkcs7 *mp7,
 	gnutls_datum_t mscat_data = {
 		.size = 0,
 	};
-	DATA_BLOB blob;
+	DATA_BLOB blob = {
+		.length = 0,
+	};
 	int rc;
 
 	tmp_ctx = talloc_new(mp7);
@@ -164,7 +166,9 @@ int mscat_pkcs7_verify(struct mscat_pkcs7 *mp7,
 	TALLOC_CTX *tmp_ctx = NULL;
 	gnutls_x509_trust_list_t tl = NULL;
 	gnutls_datum_t ca_data;
-	DATA_BLOB blob;
+	DATA_BLOB blob = {
+		.length = 0,
+	};
 	uint32_t flags = 0;
 	const char *oid;
 	int count;
diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c
index d6ef28c140f..9ad85bbf55f 100644
--- a/source3/lib/gencache.c
+++ b/source3/lib/gencache.c
@@ -219,11 +219,11 @@ bool gencache_set_data_blob(const char *keystr, DATA_BLOB blob,
 	dbufs[2] = (TDB_DATA) { .dptr = (uint8_t *)&crc,
 				.dsize = sizeof(crc) };
 
-	DEBUG(10, ("Adding cache entry with key=[%s] and timeout="
-	           "[%s] (%d seconds %s)\n", keystr,
+	DBG_DEBUG("Adding cache entry with key=[%s] and timeout="
+	           "[%s] (%ld seconds %s)\n", keystr,
 		   timestring(talloc_tos(), timeout),
-		   (int)(timeout - time(NULL)), 
-		   timeout > time(NULL) ? "ahead" : "in the past"));
+		   ((long int)timeout) - time(NULL),
+		   timeout > time(NULL) ? "ahead" : "in the past");
 
 	ret = tdb_chainlock(cache->tdb, key);
 	if (ret == -1) {
diff --git a/source4/dsdb/samdb/ldb_modules/acl_read.c b/source4/dsdb/samdb/ldb_modules/acl_read.c
index 6ab4780a196..5a193e6d925 100644
--- a/source4/dsdb/samdb/ldb_modules/acl_read.c
+++ b/source4/dsdb/samdb/ldb_modules/acl_read.c
@@ -458,7 +458,8 @@ static int aclread_callback(struct ldb_request *req, struct ldb_reply *ares)
 	struct aclread_context *ac;
 	struct ldb_message *ret_msg;
 	struct ldb_message *msg;
-	int ret, num_of_attrs = 0;
+	int ret;
+	size_t num_of_attrs = 0;
 	unsigned int i, k = 0;
 	struct security_descriptor *sd = NULL;
 	struct dom_sid *sid = NULL;
diff --git a/source4/dsdb/samdb/ldb_modules/audit_log.c b/source4/dsdb/samdb/ldb_modules/audit_log.c
index 5d6ebc1e165..28d824acfff 100644
--- a/source4/dsdb/samdb/ldb_modules/audit_log.c
+++ b/source4/dsdb/samdb/ldb_modules/audit_log.c
@@ -829,7 +829,7 @@ static char *log_attributes(
 	enum ldb_request_type operation,
 	const struct ldb_message *message)
 {
-	int i, j;
+	size_t i, j;
 	for (i=0;i<message->num_elements;i++) {
 		if (i > 0) {
 			buffer = talloc_asprintf_append_buffer(buffer, " ");
@@ -840,7 +840,7 @@ static char *log_attributes(
 				ldb,
 				LDB_DEBUG_ERROR,
 				"Error: Invalid element name (NULL) at "
-				"position %d", i);
+				"position %zu", i);
 			return NULL;
 		}
 
@@ -874,7 +874,7 @@ static char *log_attributes(
 		for (j=0;j<message->elements[i].num_values;j++) {
 			struct ldb_val v;
 			bool use_b64_encode = false;
-			int length;
+			size_t length;
 			if (j > 0) {
 				buffer = talloc_asprintf_append_buffer(
 					buffer,
@@ -898,8 +898,8 @@ static char *log_attributes(
 				buffer = talloc_asprintf_append_buffer(
 					buffer,
 					"[%*.*s%s]",
-					length,
-					length,
+					(int)length,
+					(int)length,
 					(char *)v.data,
 					(v.length > MAX_LENGTH ? "..." : ""));
 			}
diff --git a/source4/kdc/kdc-heimdal.c b/source4/kdc/kdc-heimdal.c
index b5de5a790d4..ee4e1387def 100644
--- a/source4/kdc/kdc-heimdal.c
+++ b/source4/kdc/kdc-heimdal.c
@@ -128,7 +128,7 @@ static NTSTATUS kdc_startup_interfaces(struct kdc_server *kdc,
 	/* if we are allowing incoming packets from any address, then
 	   we need to bind to the wildcard address */
 	if (!lpcfg_bind_interfaces_only(lp_ctx)) {
-		int num_binds = 0;
+		size_t num_binds = 0;
 		char **wcard = iface_list_wildcard(kdc);
 		NT_STATUS_HAVE_NO_MEMORY(wcard);
 		for (i=0; wcard[i]; i++) {


-- 
Samba Shared Repository



More information about the samba-cvs mailing list