[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Tue Nov 14 02:56:03 UTC 2017


The branch, master has been updated
       via  2e5ea35 smbtorture: Remove an unused variable
       via  a1b2daa dreplsrv: Use is_null_sid
       via  01a5462 lib: Save a few bytes of .text
       via  3b2ba9c rpcclient: Avoid a ZERO_STRUCT, save a few bytes .text
       via  1c6e270 lib: Avoid a ZERO_STRUCT, save a few bytes .text
       via  1f071b1 smbd: Avoid an "else"
       via  cd5d726 util_tdb: Make a few functions static
       via  3c50275 passdb: Fix a typo
       via  b0e2c66 libcli: Fix a signed/unsigned hickup
       via  fe4e24e netsamlogon_cache: Use ndr_pull_struct_blob_all
      from  2e573ee tevent: version 0.9.34

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


- Log -----------------------------------------------------------------
commit 2e5ea35f0b6c114581a8434a8b8824d17b353062
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Nov 12 16:09:35 2017 +0100

    smbtorture: Remove an unused variable
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Tue Nov 14 03:55:37 CET 2017 on sn-devel-144

commit a1b2daa06f85772fd23b59b24c838b6f699dce89
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Nov 12 16:07:48 2017 +0100

    dreplsrv: Use is_null_sid
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 01a54627a09d1c0d32aba3faf1b114a46f1e5bff
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Nov 12 14:55:40 2017 +0100

    lib: Save a few bytes of .text
    
    Looks surprising, but this does save bytes if you look at the object with
    "size".
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 3b2ba9c884931808cc1870dbad5d072366b16d2a
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Nov 12 14:48:24 2017 +0100

    rpcclient: Avoid a ZERO_STRUCT, save a few bytes .text
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 1c6e2704fb8f97ab8658df6354e9b5dc1e7b1b96
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Nov 12 14:48:24 2017 +0100

    lib: Avoid a ZERO_STRUCT, save a few bytes .text
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 1f071b1a25b33d5667acd6d4185de2a4b6826b2d
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Aug 4 10:44:59 2017 +0200

    smbd: Avoid an "else"
    
    We always return in the if-branch before. The else is redundant
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit cd5d726c89466b4e5af11d02d98ad8be7af936da
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Aug 3 17:08:48 2017 +0200

    util_tdb: Make a few functions static
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 3c5027556aece81942bc8dc3baed25cd8d869653
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Aug 4 14:47:17 2017 +0200

    passdb: Fix a typo
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit b0e2c669e14c83cbd198c5ea4bee94e276402c9f
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Nov 13 08:53:04 2017 +0100

    libcli: Fix a signed/unsigned hickup
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit fe4e24e143c28fd98faaac97ef6bc56180f0ecc7
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Aug 3 17:03:26 2017 +0200

    netsamlogon_cache: Use ndr_pull_struct_blob_all
    
    Be a bit more strict for error checking
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

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

Summary of changes:
 lib/util/util_tdb.c                  | 11 +++++++----
 lib/util/util_tdb.h                  | 24 ------------------------
 libcli/security/util_sid.c           |  4 ++--
 source3/libnet/libnet_dssync.c       |  4 +---
 source3/libsmb/samlogon_cache.c      |  5 +++--
 source3/passdb/lookup_sid.c          |  2 +-
 source3/rpcclient/cmd_drsuapi.c      |  4 +---
 source3/smbd/process.c               |  3 ++-
 source4/dsdb/repl/drepl_partitions.c |  4 +---
 source4/torture/drs/rpc/dssync.c     |  2 --
 10 files changed, 18 insertions(+), 45 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/util_tdb.c b/lib/util/util_tdb.c
index e3eefda..24fb658 100644
--- a/lib/util/util_tdb.c
+++ b/lib/util/util_tdb.c
@@ -132,7 +132,7 @@ void tdb_read_unlock_bystring(struct tdb_context *tdb, const char *keyval)
  Output is int32_t in native byte order.
 ****************************************************************************/
 
-int32_t tdb_fetch_int32_byblob(struct tdb_context *tdb, TDB_DATA key)
+static int32_t tdb_fetch_int32_byblob(struct tdb_context *tdb, TDB_DATA key)
 {
 	TDB_DATA data;
 	int32_t ret;
@@ -163,7 +163,8 @@ int32_t tdb_fetch_int32(struct tdb_context *tdb, const char *keystr)
  Input is int32_t in native byte order. Output in tdb is in little-endian.
 ****************************************************************************/
 
-int tdb_store_int32_byblob(struct tdb_context *tdb, TDB_DATA key, int32_t v)
+static int tdb_store_int32_byblob(struct tdb_context *tdb, TDB_DATA key,
+				  int32_t v)
 {
 	TDB_DATA data;
 	int32_t v_store;
@@ -190,7 +191,8 @@ int tdb_store_int32(struct tdb_context *tdb, const char *keystr, int32_t v)
  Output is uint32_t in native byte order.
 ****************************************************************************/
 
-bool tdb_fetch_uint32_byblob(struct tdb_context *tdb, TDB_DATA key, uint32_t *value)
+static bool tdb_fetch_uint32_byblob(struct tdb_context *tdb, TDB_DATA key,
+				    uint32_t *value)
 {
 	TDB_DATA data;
 
@@ -220,7 +222,8 @@ bool tdb_fetch_uint32(struct tdb_context *tdb, const char *keystr, uint32_t *val
  Input is uint32_t in native byte order. Output in tdb is in little-endian.
 ****************************************************************************/
 
-bool tdb_store_uint32_byblob(struct tdb_context *tdb, TDB_DATA key, uint32_t value)
+static bool tdb_store_uint32_byblob(struct tdb_context *tdb, TDB_DATA key,
+				    uint32_t value)
 {
 	TDB_DATA data;
 	uint32_t v_store;
diff --git a/lib/util/util_tdb.h b/lib/util/util_tdb.h
index 63d80d1..de82660 100644
--- a/lib/util/util_tdb.h
+++ b/lib/util/util_tdb.h
@@ -55,48 +55,24 @@ int tdb_read_lock_bystring(struct tdb_context *tdb, const char *keyval);
 void tdb_read_unlock_bystring(struct tdb_context *tdb, const char *keyval);
 
 /****************************************************************************
- Fetch a int32_t value by a arbitrary blob key, return -1 if not found.
- Output is int32_t in native byte order.
-****************************************************************************/
-int32_t tdb_fetch_int32_byblob(struct tdb_context *tdb, TDB_DATA key);
-
-/****************************************************************************
  Fetch a int32_t value by string key, return -1 if not found.
  Output is int32_t in native byte order.
 ****************************************************************************/
 int32_t tdb_fetch_int32(struct tdb_context *tdb, const char *keystr);
 
 /****************************************************************************
- Store a int32_t value by an arbitrary blob key, return 0 on success, -ve on failure.
- Input is int32_t in native byte order. Output in tdb is in little-endian.
-****************************************************************************/
-int tdb_store_int32_byblob(struct tdb_context *tdb, TDB_DATA key, int32_t v);
-
-/****************************************************************************
  Store a int32_t value by string key, return 0 on success, -ve on failure.
  Input is int32_t in native byte order. Output in tdb is in little-endian.
 ****************************************************************************/
 int tdb_store_int32(struct tdb_context *tdb, const char *keystr, int32_t v);
 
 /****************************************************************************
- Fetch a uint32_t value by a arbitrary blob key, return -1 if not found.
- Output is uint32_t in native byte order.
-****************************************************************************/
-bool tdb_fetch_uint32_byblob(struct tdb_context *tdb, TDB_DATA key, uint32_t *value);
-
-/****************************************************************************
  Fetch a uint32_t value by string key, return -1 if not found.
  Output is uint32_t in native byte order.
 ****************************************************************************/
 bool tdb_fetch_uint32(struct tdb_context *tdb, const char *keystr, uint32_t *value);
 
 /****************************************************************************
- Store a uint32_t value by an arbitrary blob key, return true on success, false on failure.
- Input is uint32_t in native byte order. Output in tdb is in little-endian.
-****************************************************************************/
-bool tdb_store_uint32_byblob(struct tdb_context *tdb, TDB_DATA key, uint32_t value);
-
-/****************************************************************************
  Store a uint32_t value by string key, return true on success, false on failure.
  Input is uint32_t in native byte order. Output in tdb is in little-endian.
 ****************************************************************************/
diff --git a/libcli/security/util_sid.c b/libcli/security/util_sid.c
index 0709a7a..e84cfb4 100644
--- a/libcli/security/util_sid.c
+++ b/libcli/security/util_sid.c
@@ -195,7 +195,7 @@ static const struct {
 
 const char *sid_type_lookup(uint32_t sid_type)
 {
-	int i;
+	size_t i;
 
 	/* Look through list */
 	for (i=0; i < ARRAY_SIZE(sid_name_type); i++) {
@@ -431,6 +431,6 @@ bool add_rid_to_array_unique(TALLOC_CTX *mem_ctx,
 
 bool is_null_sid(const struct dom_sid *sid)
 {
-	static const struct dom_sid null_sid = {0};
+	const struct dom_sid null_sid = {0};
 	return dom_sid_equal(sid, &null_sid);
 }
diff --git a/source3/libnet/libnet_dssync.c b/source3/libnet/libnet_dssync.c
index 267709e..e593ae8 100644
--- a/source3/libnet/libnet_dssync.c
+++ b/source3/libnet/libnet_dssync.c
@@ -337,7 +337,6 @@ static NTSTATUS libnet_dssync_build_request(TALLOC_CTX *mem_ctx,
 	uint32_t count;
 	uint32_t level;
 	union drsuapi_DsGetNCChangesRequest req;
-	struct dom_sid null_sid;
 	enum drsuapi_DsExtendedOperation extended_op;
 	struct drsuapi_DsReplicaObjectIdentifier *nc = NULL;
 	struct drsuapi_DsReplicaCursorCtrEx *cursors = NULL;
@@ -348,7 +347,6 @@ static NTSTATUS libnet_dssync_build_request(TALLOC_CTX *mem_ctx,
 				  DRSUAPI_DRS_GET_ANC |
 				  DRSUAPI_DRS_NEVER_SYNCED;
 
-	ZERO_STRUCT(null_sid);
 	ZERO_STRUCT(req);
 
 	if (ctx->remote_info28.supported_extensions
@@ -366,7 +364,7 @@ static NTSTATUS libnet_dssync_build_request(TALLOC_CTX *mem_ctx,
 	}
 	nc->dn = dn;
 	nc->guid = GUID_zero();
-	nc->sid = null_sid;
+	nc->sid = (struct dom_sid) {0};
 
 	if (!ctx->single_object_replication &&
 	    !ctx->force_full_replication && utdv)
diff --git a/source3/libsmb/samlogon_cache.c b/source3/libsmb/samlogon_cache.c
index 0a2890e..70645f2 100644
--- a/source3/libsmb/samlogon_cache.c
+++ b/source3/libsmb/samlogon_cache.c
@@ -253,8 +253,9 @@ struct netr_SamInfo3 *netsamlogon_cache_get(TALLOC_CTX *mem_ctx, const struct do
 
 	blob = data_blob_const(data.dptr, data.dsize);
 
-	ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, &r,
-				      (ndr_pull_flags_fn_t)ndr_pull_netsamlogoncache_entry);
+	ndr_err = ndr_pull_struct_blob_all(
+		&blob, mem_ctx, &r,
+		(ndr_pull_flags_fn_t)ndr_pull_netsamlogoncache_entry);
 
 	if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 		DEBUG(0,("netsamlogon_cache_get: failed to pull entry from cache\n"));
diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c
index b06dd1b..eeaf2b7 100644
--- a/source3/passdb/lookup_sid.c
+++ b/source3/passdb/lookup_sid.c
@@ -178,7 +178,7 @@ bool lookup_name(TALLOC_CTX *mem_ctx,
 
 	/*
 	 * Finally check for a well known domain name ("NT Authority"),
-	 * this is taken care if in lookup_wellknown_name().
+	 * this is being taken care of in lookup_wellknown_name().
 	 */
 	if ((domain[0] != '\0') &&
 	    (flags & LOOKUP_NAME_WKN) &&
diff --git a/source3/rpcclient/cmd_drsuapi.c b/source3/rpcclient/cmd_drsuapi.c
index 6a1fac7..b2221a7 100644
--- a/source3/rpcclient/cmd_drsuapi.c
+++ b/source3/rpcclient/cmd_drsuapi.c
@@ -328,7 +328,6 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli,
 	union drsuapi_DsGetNCChangesRequest req;
 	union drsuapi_DsGetNCChangesCtr ctr;
 	struct drsuapi_DsReplicaObjectIdentifier nc;
-	struct dom_sid null_sid;
 
 	struct drsuapi_DsGetNCChangesCtr1 *ctr1 = NULL;
 	struct drsuapi_DsGetNCChangesCtr6 *ctr6 = NULL;
@@ -362,7 +361,6 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli,
 
 	ZERO_STRUCT(info28);
 
-	ZERO_STRUCT(null_sid);
 	ZERO_STRUCT(req);
 
 	GUID_from_string(DRSUAPI_DS_BIND_GUID, &bind_guid);
@@ -463,7 +461,7 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli,
 
 	nc.dn = nc_dn;
 	nc.guid = GUID_zero();
-	nc.sid = null_sid;
+	nc.sid = (struct dom_sid) {0};
 
 	if (supported_extensions & DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8) {
 		level = 8;
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index b65ae2c..11a5ae8 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -1973,7 +1973,8 @@ static void process_smb(struct smbXsrv_connection *xconn,
 			size_t pdulen = nread - NBT_HDR_SIZE;
 			smbd_smb2_process_negprot(xconn, 0, inpdu, pdulen);
 			return;
-		} else if (nread >= smb_size && valid_smb_header(inbuf)
+		}
+		if (nread >= smb_size && valid_smb_header(inbuf)
 				&& CVAL(inbuf, smb_com) != 0x72) {
 			/* This is a non-negprot SMB1 packet.
 			   Disable SMB2 from now on. */
diff --git a/source4/dsdb/repl/drepl_partitions.c b/source4/dsdb/repl/drepl_partitions.c
index 586da19..83ea358 100644
--- a/source4/dsdb/repl/drepl_partitions.c
+++ b/source4/dsdb/repl/drepl_partitions.c
@@ -445,12 +445,10 @@ WERROR dreplsrv_partition_find_for_nc(struct dreplsrv_service *s,
 {
 	struct dreplsrv_partition *p;
 	bool valid_sid, valid_guid;
-	struct dom_sid null_sid;
-	ZERO_STRUCT(null_sid);
 
 	SMB_ASSERT(_p);
 
-	valid_sid  = nc_sid && !dom_sid_equal(&null_sid, nc_sid);
+	valid_sid  = nc_sid && !is_null_sid(nc_sid);
 	valid_guid = nc_guid && !GUID_all_zero(nc_guid);
 
 	if (!valid_sid && !valid_guid && (!nc_dn_str)) {
diff --git a/source4/torture/drs/rpc/dssync.c b/source4/torture/drs/rpc/dssync.c
index 27cc72f..67fde7c 100644
--- a/source4/torture/drs/rpc/dssync.c
+++ b/source4/torture/drs/rpc/dssync.c
@@ -935,11 +935,9 @@ static bool test_FetchNT4Data(struct torture_context *tctx,
 	union drsuapi_DsGetNT4ChangeLogInfo info;
 	uint32_t level_out = 0;
 	struct GUID null_guid;
-	struct dom_sid null_sid;
 	DATA_BLOB cookie;
 
 	ZERO_STRUCT(null_guid);
-	ZERO_STRUCT(null_sid);
 	ZERO_STRUCT(cookie);
 
 	ZERO_STRUCT(r);


-- 
Samba Shared Repository



More information about the samba-cvs mailing list