[SCM] Samba Shared Repository - branch master updated

Günther Deschner gd at samba.org
Mon Jan 10 04:47:01 MST 2011


The branch, master has been updated
       via  45227e9 libcli/security: fix sid_type_lookup().
      from  1c6d896 m4: Don't AC_MSG_ERROR when too old python is found

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


- Log -----------------------------------------------------------------
commit 45227e96c2cff017dd0ecd29d9e93e89d71b7573
Author: Günther Deschner <gd at samba.org>
Date:   Mon Jan 10 11:57:18 2011 +0100

    libcli/security: fix sid_type_lookup().
    
    It *always* returned "SID *TYPE* is INVALID".
    
    Guenther
    
    Autobuild-User: Günther Deschner <gd at samba.org>
    Autobuild-Date: Mon Jan 10 12:47:00 CET 2011 on sn-devel-104

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

Summary of changes:
 libcli/security/util_sid.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/libcli/security/util_sid.c b/libcli/security/util_sid.c
index 52d48ce..3d14536 100644
--- a/libcli/security/util_sid.c
+++ b/libcli/security/util_sid.c
@@ -126,20 +126,18 @@ static const struct {
 	{SID_NAME_DELETED, "Deleted Account"},
 	{SID_NAME_INVALID, "Invalid Account"},
 	{SID_NAME_UNKNOWN, "UNKNOWN"},
-	{SID_NAME_COMPUTER, "Computer"},
-
-	{(enum lsa_SidType)0, NULL}
+	{SID_NAME_COMPUTER, "Computer"}
 };
 
 const char *sid_type_lookup(uint32_t sid_type)
 {
-	int i = 0;
+	int i;
 
 	/* Look through list */
-	while(sid_name_type[i].sid_type != 0) {
-		if (sid_name_type[i].sid_type == sid_type)
+	for (i=0; i < ARRAY_SIZE(sid_name_type); i++) {
+		if (sid_name_type[i].sid_type == sid_type) {
 			return sid_name_type[i].string;
-		i++;
+		}
 	}
 
 	/* Default return */


-- 
Samba Shared Repository


More information about the samba-cvs mailing list