[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Sat Oct 20 00:18:03 UTC 2018


The branch, master has been updated
       via  d15a00b s3:smbcontrol: Simplify the return code check
       via  1ca21b9 s4:torture: Fix the scope of the req variable in drsuapi test
       via  f040d66 ndr: Init variables of GUID_from_data_blob()
       via  2679dd0 s3:registry: Avoid a double-free in reg_perfcount
       via  9e03fb6 talloc: deprecate talloc_set_memlimit()
      from  5b2c3f2 lib: Remove gencache.h from proto.h

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


- Log -----------------------------------------------------------------
commit d15a00babf3e2940a03fd9a70c1c54951f4f8660
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Sep 26 14:47:20 2018 +0200

    s3:smbcontrol: Simplify the return code check
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Sat Oct 20 02:17:56 CEST 2018 on sn-devel-144

commit 1ca21b98231d8ea9473f7cb8838cdb21f4663657
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Sep 26 14:34:07 2018 +0200

    s4:torture: Fix the scope of the req variable in drsuapi test
    
    Found by covscan.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit f040d660c0312dddbf03a9a6762044425d82fcb6
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Sep 26 14:30:32 2018 +0200

    ndr: Init variables of GUID_from_data_blob()
    
    Found by covscan.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 2679dd0fd87903822f7ed29cfb88834838e69346
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Sep 26 14:29:50 2018 +0200

    s3:registry: Avoid a double-free in reg_perfcount
    
    Found by covscan.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 9e03fb60dca0ebafa8bf8095d6e21659bdf453ee
Author: David Disseldorp <ddiss at samba.org>
Date:   Tue Oct 16 19:06:48 2018 +0200

    talloc: deprecate talloc_set_memlimit()
    
    The memlimit functionality was never utilized by Samba. It adds unneeded
    complexity, so flag it as deprecated.
    
    Signed-off-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

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

Summary of changes:
 lib/talloc/talloc.h              | 12 +++++++++++-
 librpc/ndr/uuid.c                | 11 ++++++-----
 source3/registry/reg_perfcount.c |  4 ++--
 source3/utils/smbcontrol.c       |  9 ++++-----
 source4/torture/rpc/drsuapi.c    |  2 +-
 5 files changed, 24 insertions(+), 14 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/talloc/talloc.h b/lib/talloc/talloc.h
index 7372df1..ba3dee8 100644
--- a/lib/talloc/talloc.h
+++ b/lib/talloc/talloc.h
@@ -1893,6 +1893,13 @@ void talloc_set_log_fn(void (*log_fn)(const char *message));
  */
 void talloc_set_log_stderr(void);
 
+#ifndef _DEPRECATED_
+#ifdef HAVE___ATTRIBUTE__
+#define _DEPRECATED_ __attribute__ ((deprecated))
+#else
+#define _DEPRECATED_
+#endif
+#endif
 /**
  * @brief Set a max memory limit for the current context hierarchy
  *	  This affects all children of this context and constrain any
@@ -1907,10 +1914,13 @@ void talloc_set_log_stderr(void);
  *	  move causes the new parent to exceed its limits. However
  *	  any further allocation on that hierarchy will then fail.
  *
+ * @warning talloc memlimit functionality is deprecated. Please
+ *	    consider using cgroup memory limits instead.
+ *
  * @param[in]	ctx		The talloc context to set the limit on
  * @param[in]	max_size	The (new) max_size
  */
-int talloc_set_memlimit(const void *ctx, size_t max_size);
+int talloc_set_memlimit(const void *ctx, size_t max_size) _DEPRECATED_;
 
 /* @} ******************************************************************/
 
diff --git a/librpc/ndr/uuid.c b/librpc/ndr/uuid.c
index 53540c7..6c50821 100644
--- a/librpc/ndr/uuid.c
+++ b/librpc/ndr/uuid.c
@@ -59,11 +59,12 @@ _PUBLIC_ NTSTATUS GUID_from_ndr_blob(const DATA_BLOB *b, struct GUID *guid)
 _PUBLIC_ NTSTATUS GUID_from_data_blob(const DATA_BLOB *s, struct GUID *guid)
 {
 	NTSTATUS status = NT_STATUS_INVALID_PARAMETER;
-	uint32_t time_low;
-	uint32_t time_mid, time_hi_and_version;
-	uint32_t clock_seq[2];
-	uint32_t node[6];
-	uint8_t buf16[16];
+	uint32_t time_low = 0;
+	uint32_t time_mid = 0;
+	uint32_t time_hi_and_version = 0;
+	uint32_t clock_seq[2] = {0};
+	uint32_t node[6] = {0};
+	uint8_t buf16[16] = {0};
 
 	DATA_BLOB blob16 = data_blob_const(buf16, sizeof(buf16));
 	int i;
diff --git a/source3/registry/reg_perfcount.c b/source3/registry/reg_perfcount.c
index 6fa96f3..394930b 100644
--- a/source3/registry/reg_perfcount.c
+++ b/source3/registry/reg_perfcount.c
@@ -186,9 +186,9 @@ static uint32_t _reg_perfcount_multi_sz_from_tdb(TDB_CONTEXT *tdb,
 	}
 	/* First encode the name_index */
 	working_size = (kbuf.dsize + 1)*sizeof(uint16_t);
+	/* SMB_REALLOC frees buf1 on error */
 	p = (char *)SMB_REALLOC(buf1, buffer_size + working_size);
 	if (p == NULL) {
-		SAFE_FREE(buf1);
 		buffer_size = 0;
 		return buffer_size;
 	}
@@ -203,9 +203,9 @@ static uint32_t _reg_perfcount_multi_sz_from_tdb(TDB_CONTEXT *tdb,
 	buffer_size += working_size;
 	/* Now encode the actual name */
 	working_size = (dbuf.dsize + 1)*sizeof(uint16_t);
+	/* SMB_REALLOC frees buf1 on error */
 	p = (char *)SMB_REALLOC(buf1, buffer_size + working_size);
 	if (p == NULL) {
-		SAFE_FREE(buf1);
 		buffer_size = 0;
 		return buffer_size;
 	}
diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c
index e23e128..597bab6 100644
--- a/source3/utils/smbcontrol.c
+++ b/source3/utils/smbcontrol.c
@@ -1142,14 +1142,13 @@ static bool do_winbind_offline(struct tevent_context *ev_ctx,
 
 		/* Check that the entry "WINBINDD_OFFLINE" still exists. */
 		d = tdb_fetch_bystring( tdb, "WINBINDD_OFFLINE" );
-
-		if (!d.dptr || d.dsize != 4) {
-			SAFE_FREE(d.dptr);
-			DEBUG(10,("do_winbind_offline: offline state not set - retrying.\n"));
-		} else {
+		if (d.dptr != NULL && d.dsize == 4) {
 			SAFE_FREE(d.dptr);
 			break;
 		}
+
+		SAFE_FREE(d.dptr);
+		DEBUG(10,("do_winbind_offline: offline state not set - retrying.\n"));
 	}
 
 	tdb_close(tdb);
diff --git a/source4/torture/rpc/drsuapi.c b/source4/torture/rpc/drsuapi.c
index 1d535ac..a424a31 100644
--- a/source4/torture/rpc/drsuapi.c
+++ b/source4/torture/rpc/drsuapi.c
@@ -94,6 +94,7 @@ static bool test_DsGetDomainControllerInfo(struct torture_context *tctx,
 	struct dcerpc_pipe *p = priv->drs_pipe;
 	struct drsuapi_DsGetDomainControllerInfo r;
 	union drsuapi_DsGetDCInfoCtr ctr;
+	union drsuapi_DsGetDCInfoRequest req;
 	int32_t level_out = 0;
 	bool found = false;
 	int i, j, k;
@@ -124,7 +125,6 @@ static bool test_DsGetDomainControllerInfo(struct torture_context *tctx,
 
 	for (i=0; i < ARRAY_SIZE(levels); i++) {
 		for (j=0; j < ARRAY_SIZE(names); j++) {
-			union drsuapi_DsGetDCInfoRequest req;
 			level = levels[i];
 			r.in.bind_handle = &priv->bind_handle;
 			r.in.level = 1;


-- 
Samba Shared Repository



More information about the samba-cvs mailing list