[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Fri Mar 8 01:42:02 UTC 2019


The branch, master has been updated
       via  c71334ec0c9 lib:util: Move debug message for mkdir failing to log level 1
       via  5bc215f70af samba-o3: fix -Werror=maybe-uninitialized in lib/mscat/mscat_pks7.c
       via  16d40ffcf04 samba-o3: fix -Werror=strict-overflow error in s4/torture/raw/eas module
       via  3ddb5429a0b samba-o3: fix -Werror=strict-overflow error in lib/ldb-samba/ldb_ildap module
      from  c25e7953c6a pygpo: take ownership of password pointer

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


- Log -----------------------------------------------------------------
commit c71334ec0c92e791022a9b7c900aa0dd649226c2
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Mar 7 12:31:42 2019 +0100

    lib:util: Move debug message for mkdir failing to log level 1
    
    If you connnect to a host with smbclient this gets always printed.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13823
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Fri Mar  8 01:41:27 UTC 2019 on sn-devel-144

commit 5bc215f70af6fbf97baac1cdac9201701d8edf70
Author: Joe Guo <joeg at catalyst.net.nz>
Date:   Fri Dec 21 13:47:45 2018 +1300

    samba-o3: fix -Werror=maybe-uninitialized in lib/mscat/mscat_pks7.c
    
    samba-o3 test failed in ubuntu:1804 image with:
    
        ../../lib/mscat/mscat_pkcs7.c: In function ‘mscat_pkcs7_import_catfile’:
        ../../lib/mscat/mscat_pkcs7.c:143:18: error: ‘blob.length’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
          mscat_data.size = blob.length;
          ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
        ../../lib/mscat/mscat_pkcs7.c:142:18: error: ‘blob.data’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
          mscat_data.data = blob.data;
          ~~~~~~~~~~~~~~~~^~~~~~~~~~~
        ../../lib/mscat/mscat_pkcs7.c: In function ‘mscat_pkcs7_verify’:
        ../../lib/mscat/mscat_pkcs7.c:225:16: error: ‘blob.length’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
           ca_data.size = blob.length;
           ~~~~~~~~~~~~~^~~~~~~~~~~~~
        ../../lib/mscat/mscat_pkcs7.c:224:16: error: ‘blob.data’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
           ca_data.data = blob.data;
           ~~~~~~~~~~~~~^~~~~~~~~~~
        cc1: all warnings being treated as errors
    
    Since in `mscat_read_file`, it may still return rc = 0 while goto error,
    ends up with blob uninitialized.
    
    Signed-off-by: Joe Guo <joeg at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 16d40ffcf04a0c3c7dd8699cf7980ed1fb32612a
Author: Joe Guo <joeg at catalyst.net.nz>
Date:   Wed Dec 19 14:37:33 2018 +1300

    samba-o3: fix -Werror=strict-overflow error in s4/torture/raw/eas module
    
    samba-o3 test failed in ubuntu:16.04 docker container:
    
        ==> /home/samba/samba/samba-o3.stderr <==
        ../../source4/torture/raw/eas.c: In function ‘test_max_eas’:
        ../../source4/torture/raw/eas.c:286:12: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
         static bool test_max_eas(struct smbcli_state *cli, struct torture_context *tctx)
                    ^
        cc1: all warnings being treated as errors
    
    `total += j` may overflow. Change total type to `size_t` to mute error.
    
    Signed-off-by: Joe Guo <joeg at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 3ddb5429a0b67f4867ef2730d0817d432486b15c
Author: Joe Guo <joeg at catalyst.net.nz>
Date:   Wed Dec 19 14:25:12 2018 +1300

    samba-o3: fix -Werror=strict-overflow error in lib/ldb-samba/ldb_ildap module
    
    samba-o3 test failed in ubuntu:16.04 docker container:
    
        ==> /home/samba/samba/samba-o3.stderr <==
        ../../lib/ldb-samba/ldb_ildap.c: In function ‘ildb_handle_request’:
        ../../lib/ldb-samba/ldb_ildap.c:535:2: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
          for (i = 0; i < n; i++) {
          ^
        ../../lib/ldb-samba/ldb_ildap.c:579:2: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
          for (i = 0; i < n; i++) {
          ^
        cc1: all warnings being treated as errors
    
    Change type to mute errors.
    
    Signed-off-by: Joe Guo <joeg at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

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

Summary of changes:
 lib/ldb-samba/ldb_ildap.c | 8 ++++----
 lib/mscat/mscat_pkcs7.c   | 6 +++++-
 lib/util/util.c           | 6 +++---
 source4/torture/raw/eas.c | 5 +++--
 4 files changed, 15 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/ldb-samba/ldb_ildap.c b/lib/ldb-samba/ldb_ildap.c
index 1b9a25ea3a7..2c32395db70 100644
--- a/lib/ldb-samba/ldb_ildap.c
+++ b/lib/ldb-samba/ldb_ildap.c
@@ -114,13 +114,13 @@ static void ildb_auto_done_callback(struct tevent_context *ev,
   convert a ldb_message structure to a list of ldap_mod structures
   ready for ildap_add() or ildap_modify()
 */
-static struct ldap_mod **ildb_msg_to_mods(void *mem_ctx, int *num_mods,
+static struct ldap_mod **ildb_msg_to_mods(void *mem_ctx, unsigned int *num_mods,
 					  const struct ldb_message *msg,
 					  int use_flags)
 {
 	struct ldap_mod **mods;
 	unsigned int i;
-	int n = 0;
+	unsigned int n = 0;
 
 	/* allocate maximum number of elements needed */
 	mods = talloc_array(mem_ctx, struct ldap_mod *, msg->num_elements+1);
@@ -504,7 +504,7 @@ static int ildb_add(struct ildb_context *ac)
 	struct ldb_request *req = ac->req;
 	struct ldap_message *msg;
 	struct ldap_mod **mods;
-	int i,n;
+	unsigned int i,n;
 
 	msg = new_ldap_message(req);
 	if (msg == NULL) {
@@ -548,7 +548,7 @@ static int ildb_modify(struct ildb_context *ac)
 	struct ldb_request *req = ac->req;
 	struct ldap_message *msg;
 	struct ldap_mod **mods;
-	int i,n;
+	unsigned int i,n;
 
 	msg = new_ldap_message(req);
 	if (msg == NULL) {
diff --git a/lib/mscat/mscat_pkcs7.c b/lib/mscat/mscat_pkcs7.c
index d606a86f095..5d882891313 100644
--- a/lib/mscat/mscat_pkcs7.c
+++ b/lib/mscat/mscat_pkcs7.c
@@ -66,7 +66,7 @@ static int mscat_read_file(TALLOC_CTX *mem_ctx,
 	struct stat sb = {0};
 	size_t alloc_size;
 	size_t count;
-	DATA_BLOB blob;
+	DATA_BLOB blob = data_blob_null;
 	FILE *fp;
 	int rc;
 
@@ -82,22 +82,26 @@ static int mscat_read_file(TALLOC_CTX *mem_ctx,
 
 	if (!S_ISREG(sb.st_mode)) {
 		errno = EINVAL;
+		rc = -1;
 		goto error;
 	}
 	if (SIZE_MAX - 1 < (unsigned long)sb.st_size) {
 		errno = ENOMEM;
+		rc = -1;
 		goto error;
 	}
 	alloc_size = sb.st_size + 1;
 
 	blob = data_blob_talloc_zero(mem_ctx, alloc_size);
 	if (blob.data == NULL) {
+		rc = -1;
 		goto error;
 	}
 
 	count = fread(blob.data, 1, blob.length, fp);
 	if (count != blob.length) {
 		if (ferror(fp)) {
+			rc = -1;
 			goto error;
 		}
 	}
diff --git a/lib/util/util.c b/lib/util/util.c
index 19824b550c0..b8eed3ca28c 100644
--- a/lib/util/util.c
+++ b/lib/util/util.c
@@ -294,9 +294,9 @@ _PUBLIC_ bool directory_create_or_exist(const char *dname,
 	old_umask = umask(0);
 	ret = mkdir(dname, dir_perms);
 	if (ret == -1 && errno != EEXIST) {
-		DEBUG(0, ("mkdir failed on directory "
-			  "%s: %s\n", dname,
-			  strerror(errno)));
+		DBG_WARNING("mkdir failed on directory %s: %s\n",
+			    dname,
+			    strerror(errno));
 		umask(old_umask);
 		return false;
 	}
diff --git a/source4/torture/raw/eas.c b/source4/torture/raw/eas.c
index eace20ae83a..59baae53ad6 100644
--- a/source4/torture/raw/eas.c
+++ b/source4/torture/raw/eas.c
@@ -292,7 +292,8 @@ static bool test_max_eas(struct smbcli_state *cli, struct torture_context *tctx)
 	bool ret = true;
 	bool err = false;
 
-	int       i, j, k, last, total;
+	int       i, j, k, last;
+	size_t total;
 	DATA_BLOB eablob;
 	char      *eaname = NULL;
 	int       maxeasize;
@@ -398,7 +399,7 @@ static bool test_max_eas(struct smbcli_state *cli, struct torture_context *tctx)
 		last = j;
 	}
 
-	torture_comment(tctx, "Total EA size:%d\n", total);
+	torture_comment(tctx, "Total EA size:%zu\n", total);
 	if (i == maxeanames) {
 		torture_comment(tctx, "NOTE: More EAs could be available!\n");
 	}


-- 
Samba Shared Repository



More information about the samba-cvs mailing list