[SCM] Samba Shared Repository - branch v4-8-test updated

Karolin Seeger kseeger at samba.org
Tue Jun 26 00:27:02 UTC 2018


The branch, v4-8-test has been updated
       via  8b32d29 samdb: Fix build error with gcc8
       via  ee6bd86 s3:winbind: Fix regression introduced with bso #12851
       via  941b566 s3:smbget: Fix buffer truncation issues with gcc8
       via  5f2859e s3:registry: Fix buffer truncation issues issues with gcc8
      from  be00b89 heimdal: lib/krb5: do not fail set_config_files due to parse error

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-8-test


- Log -----------------------------------------------------------------
commit 8b32d297f12ff16bb4139afd0a16548a27ed39b9
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Jun 18 10:24:06 2018 +0200

    samdb: Fix build error with gcc8
    
    ../source4/dsdb/samdb/ldb_modules/samldb.c: In function ‘samldb_add’:
    ../source4/dsdb/samdb/ldb_modules/samldb.c:424:6: error: ‘found’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
       if (found) {
          ^
    ../source4/dsdb/samdb/ldb_modules/samldb.c:348:11: note: ‘found’ was declared here
      bool ok, found;
               ^~~~~
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>
    (cherry picked from commit 76828876faa3cd463023e323983df0be597c7361)
    
    Autobuild-User(v4-8-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-8-test): Tue Jun 26 02:26:15 CEST 2018 on sn-devel-144

commit ee6bd861f3e1f1c3de86fe05976ba22119ba2429
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Jun 20 11:38:28 2018 +0200

    s3:winbind: Fix regression introduced with bso #12851
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12851
    
    Pair-Programmed-With: Guenther Deschner <gd at samba.org>
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Signed-off-by: Guenther Deschner <gd at samba.org>
    (cherry picked from commit c1c764925e24788905ab91aa455b415765d6f71f)

commit 941b5663ca9cdbd347d8f65d6c92f4a3f36ed31a
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Jun 18 10:43:53 2018 +0200

    s3:smbget: Fix buffer truncation issues with gcc8
    
    ../source3/utils/smbget.c: In function ‘smb_download_file’:
    ../source3/utils/smbget.c:97:27: error: ‘b’ directive output may be truncated writing 1 byte into a region of size between 0 and 19 [-Werror=format-truncation=]
       snprintf(buffer, l, "%jdb", (intmax_t)s);
                               ^
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>
    (cherry picked from commit 4a3164e0beea35c1f4ce44fbe43547f7104587d1)

commit 5f2859e958e110952b73b785975420a350497cc8
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Jun 18 10:34:27 2018 +0200

    s3:registry: Fix buffer truncation issues issues with gcc8
    
    ../source3/registry/reg_perfcount.c: In function ‘reg_perfcount_get_hkpd’:
    ../source3/registry/reg_perfcount.c:337:29: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
       snprintf(buf, buflen,"%d%s", key_part1, key_part2);
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Guenther Deschner <gd at samba.org>
    (cherry picked from commit 29f6842ee86b768f3677b38c5640655e312c398e)

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

Summary of changes:
 source3/registry/reg_perfcount.c        | 12 +++++-------
 source3/utils/smbget.c                  |  2 +-
 source3/winbindd/wb_getpwsid.c          | 28 ++++++++++------------------
 source4/dsdb/samdb/ldb_modules/samldb.c |  2 +-
 4 files changed, 17 insertions(+), 27 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/registry/reg_perfcount.c b/source3/registry/reg_perfcount.c
index a8f76ac..db4451e 100644
--- a/source3/registry/reg_perfcount.c
+++ b/source3/registry/reg_perfcount.c
@@ -166,13 +166,12 @@ static uint32_t _reg_perfcount_multi_sz_from_tdb(TDB_CONTEXT *tdb,
 					       uint32_t buffer_size)
 {
 	TDB_DATA kbuf, dbuf;
-	char temp[256];
+	char temp[PERFCOUNT_MAX_LEN] = {0};
 	char *buf1 = *retbuf;
 	uint32_t working_size = 0;
 	DATA_BLOB name_index, name;
 	bool ok;
 
-	memset(temp, 0, sizeof(temp));
 	snprintf(temp, sizeof(temp), "%d", keyval);
 	kbuf = string_tdb_data(temp);
 	dbuf = tdb_fetch(tdb, kbuf);
@@ -709,13 +708,13 @@ static bool _reg_perfcount_get_instance_info(struct PERF_INSTANCE_DEFINITION *in
 					     TDB_CONTEXT *names)
 {
 	TDB_DATA key, data;
-	char buf[PERFCOUNT_MAX_LEN], temp[PERFCOUNT_MAX_LEN];
+	char buf[PERFCOUNT_MAX_LEN] = {0};
+	char temp[32] = {0};
 	smb_ucs2_t *name = NULL;
 	int pad;
 
 	/* First grab the instance data from the data file */
-	memset(temp, 0, PERFCOUNT_MAX_LEN);
-	snprintf(temp, PERFCOUNT_MAX_LEN, "i%d", instId);
+	snprintf(temp, sizeof(temp), "i%d", instId);
 	_reg_perfcount_make_key(&key, buf, PERFCOUNT_MAX_LEN, obj->ObjectNameTitleIndex, temp);
 	if (!_reg_perfcount_get_counter_data(key, &data)) {
 		DEBUG(3, ("_reg_perfcount_get_counter_data failed\n"));
@@ -739,8 +738,7 @@ static bool _reg_perfcount_get_instance_info(struct PERF_INSTANCE_DEFINITION *in
 	SAFE_FREE(data.dptr);
 
 	/* Fetch instance name */
-	memset(temp, 0, PERFCOUNT_MAX_LEN);
-	snprintf(temp, PERFCOUNT_MAX_LEN, "i%dname", instId);
+	snprintf(temp, sizeof(temp), "i%dname", instId);
 	_reg_perfcount_make_key(&key, buf, PERFCOUNT_MAX_LEN, obj->ObjectNameTitleIndex, temp);
 	data = tdb_fetch(names, key);
 	if(data.dptr == NULL)
diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c
index d2d5e00..e1be429 100644
--- a/source3/utils/smbget.c
+++ b/source3/utils/smbget.c
@@ -288,7 +288,7 @@ static void print_progress(const char *name, time_t start, time_t now,
 	double avg = 0.0;
 	long eta = -1;
 	double prcnt = 0.0;
-	char hpos[20], htotal[20], havg[20];
+	char hpos[22], htotal[22], havg[22];
 	char *status, *filename;
 	int len;
 	if (now - start) {
diff --git a/source3/winbindd/wb_getpwsid.c b/source3/winbindd/wb_getpwsid.c
index 8e114ab..8dc09eb 100644
--- a/source3/winbindd/wb_getpwsid.c
+++ b/source3/winbindd/wb_getpwsid.c
@@ -101,25 +101,17 @@ static void wb_getpwsid_queryuser_done(struct tevent_req *subreq)
 				    info->domain_name,
 				    acct_name,
 				    &mapped_name);
-	if (NT_STATUS_IS_OK(status)) {
-		output_username = fill_domain_username_talloc(state,
-				     info->domain_name,
-				     mapped_name, true);
-		if (output_username == NULL) {
-			tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
-			return;
-		}
+	if (NT_STATUS_IS_OK(status) ||
+	    NT_STATUS_EQUAL(status, NT_STATUS_FILE_RENAMED)) {
 		fstrcpy(acct_name, mapped_name);
-	} else if (NT_STATUS_EQUAL(status, NT_STATUS_FILE_RENAMED)) {
-		fstrcpy(acct_name, mapped_name);
-	} else {
-		output_username = fill_domain_username_talloc(state,
-				     info->domain_name,
-				     acct_name, true);
-		if (output_username == NULL) {
-			tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
-			return;
-		}
+	}
+	output_username = fill_domain_username_talloc(state,
+						      info->domain_name,
+						      acct_name,
+						      true);
+	if (output_username == NULL) {
+		tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+		return;
 	}
 
 	strlcpy(pw->pw_name, output_username, sizeof(pw->pw_name));
diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c
index 11da629..734d0be 100644
--- a/source4/dsdb/samdb/ldb_modules/samldb.c
+++ b/source4/dsdb/samdb/ldb_modules/samldb.c
@@ -345,7 +345,7 @@ static int samldb_generate_next_linkid(struct samldb_ctx *ac,
 static int samldb_schema_add_handle_linkid(struct samldb_ctx *ac)
 {
 	int ret;
-	bool ok, found;
+	bool ok, found = false;
 	struct ldb_message_element *el;
 	const char *enc_str;
 	const struct dsdb_attribute *attr;


-- 
Samba Shared Repository



More information about the samba-cvs mailing list