[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Mon Jun 28 02:19:06 MDT 2010


The branch, master has been updated
       via  a81b97f... s3-passdb: Make sure that we don't assign garbage.
       via  dc2e41a... librpc: Use switch in GUID_from_data_blob().
       via  b46eccf... nss_wrapper: Fixed a possible NULL pointer problem.
      from  bdfba23... s4:ldap_server: don't start if we can't bind to port 389

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


- Log -----------------------------------------------------------------
commit a81b97ff340e021c3d2a7ddfe44ec09cc2b9f0d5
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Jun 7 10:03:50 2010 +0200

    s3-passdb: Make sure that we don't assign garbage.

commit dc2e41a16ab5c203d73bfc6e9f368820221ee3ea
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Jun 7 10:00:39 2010 +0200

    librpc: Use switch in GUID_from_data_blob().

commit b46eccfb1983c3107bcce2b8b5689e37cf3ec55f
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Jun 7 09:30:29 2010 +0200

    nss_wrapper: Fixed a possible NULL pointer problem.

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

Summary of changes:
 lib/nss_wrapper/nss_wrapper.c |    2 +-
 librpc/ndr/uuid.c             |   23 ++++++++++++++++-------
 source3/passdb/lookup_sid.c   |    2 +-
 3 files changed, 18 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/nss_wrapper/nss_wrapper.c b/lib/nss_wrapper/nss_wrapper.c
index ee65350..42fc4cf 100644
--- a/lib/nss_wrapper/nss_wrapper.c
+++ b/lib/nss_wrapper/nss_wrapper.c
@@ -2172,7 +2172,7 @@ _PUBLIC_ int nwrap_getgrouplist(const char *user, gid_t group, gid_t *groups, in
 	struct group *grp;
 	gid_t *groups_tmp;
 	int count = 1;
-	const char *name_of_group = NULL;
+	const char *name_of_group = "";
 
 	if (!nwrap_enabled()) {
 		return real_getgrouplist(user, group, groups, ngroups);
diff --git a/librpc/ndr/uuid.c b/librpc/ndr/uuid.c
index 5b60531..d46da09 100644
--- a/librpc/ndr/uuid.c
+++ b/librpc/ndr/uuid.c
@@ -74,7 +74,9 @@ _PUBLIC_ NTSTATUS GUID_from_data_blob(const DATA_BLOB *s, struct GUID *guid)
 		return NT_STATUS_INVALID_PARAMETER;
 	}
 
-	if (s->length == 36) {
+	switch(s->length) {
+	case 36:
+	{
 		TALLOC_CTX *mem_ctx;
 		const char *string;
 
@@ -90,8 +92,10 @@ _PUBLIC_ NTSTATUS GUID_from_data_blob(const DATA_BLOB *s, struct GUID *guid)
 			status = NT_STATUS_OK;
 		}
 		talloc_free(mem_ctx);
-
-	} else if (s->length == 38) {
+		break;
+	}
+	case 38:
+	{
 		TALLOC_CTX *mem_ctx;
 		const char *string;
 
@@ -107,8 +111,10 @@ _PUBLIC_ NTSTATUS GUID_from_data_blob(const DATA_BLOB *s, struct GUID *guid)
 			status = NT_STATUS_OK;
 		}
 		talloc_free(mem_ctx);
-
-	} else if (s->length == 32) {
+		break;
+	}
+	case 32:
+	{
 		size_t rlen = strhex_to_str((char *)blob16.data, blob16.length,
 					    (const char *)s->data, s->length);
 		if (rlen == blob16.length) {
@@ -116,10 +122,13 @@ _PUBLIC_ NTSTATUS GUID_from_data_blob(const DATA_BLOB *s, struct GUID *guid)
 			status = NT_STATUS_OK;
 			s = &blob16;
 		}
+		break;
 	}
-
-	if (s->length == 16) {
+	case 16:
 		return GUID_from_ndr_blob(s, guid);
+	default:
+		status = NT_STATUS_INVALID_PARAMETER;
+		break;
 	}
 
 	if (!NT_STATUS_IS_OK(status)) {
diff --git a/source3/passdb/lookup_sid.c b/source3/passdb/lookup_sid.c
index d523055..9a5edcf 100644
--- a/source3/passdb/lookup_sid.c
+++ b/source3/passdb/lookup_sid.c
@@ -779,7 +779,7 @@ NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids,
 
 	for (i=0; i<num_sids; i++) {
 		struct dom_sid sid;
-		uint32 rid;
+		uint32_t rid = 0;
 		const char *domain_name = NULL;
 
 		sid_copy(&sid, sids[i]);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list