summaryrefslogtreecommitdiff
path: root/libcli/security
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2011-01-10 11:57:18 +0100
committerGünther Deschner <gd@samba.org>2011-01-10 12:47:00 +0100
commit45227e96c2cff017dd0ecd29d9e93e89d71b7573 (patch)
tree58b6d137c03c853bcbf27b8e7e782f6f3d57ed13 /libcli/security
parent1c6d89660ea6687df55248e1f45699e59562792a (diff)
downloadsamba-45227e96c2cff017dd0ecd29d9e93e89d71b7573.tar.gz
samba-45227e96c2cff017dd0ecd29d9e93e89d71b7573.tar.bz2
samba-45227e96c2cff017dd0ecd29d9e93e89d71b7573.zip
libcli/security: fix sid_type_lookup().
It *always* returned "SID *TYPE* is INVALID". Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Mon Jan 10 12:47:00 CET 2011 on sn-devel-104
Diffstat (limited to 'libcli/security')
-rw-r--r--libcli/security/util_sid.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/libcli/security/util_sid.c b/libcli/security/util_sid.c
index 52d48ce431..3d14536eae 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 */