summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2005-10-20 16:05:12 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:07 -0500
commit46c6d81a4a977c9a83cfd53c2d748876a080dc71 (patch)
tree5b967221c584b44e5af519a07b640df551bc0608
parent87d6e590f261ca6137fcaa115fcb5d6b00ed447e (diff)
downloadsamba-46c6d81a4a977c9a83cfd53c2d748876a080dc71.tar.gz
samba-46c6d81a4a977c9a83cfd53c2d748876a080dc71.tar.bz2
samba-46c6d81a4a977c9a83cfd53c2d748876a080dc71.zip
r11229: an even bigger speedup spotted by Volker. string_to_sid() is now taking 1/5th
the time it used to. Replace strcasecmp with invididual char checks for "S-" sid prefix. (This used to be commit de3d0094b78cb20da7ed958e8d3a428583694309)
-rw-r--r--source3/lib/util_sid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/lib/util_sid.c b/source3/lib/util_sid.c
index cc1f55330f..0a9e6fe310 100644
--- a/source3/lib/util_sid.c
+++ b/source3/lib/util_sid.c
@@ -262,12 +262,12 @@ BOOL string_to_sid(DOM_SID *sidout, const char *sidstr)
/* BIG NOTE: this function only does SIDS where the identauth is not >= 2^32 */
uint32 conv;
- if (StrnCaseCmp( sidstr, "S-", 2)) {
+ if ((sidstr[0] != 'S' && sidstr[0] != 's') || sidstr[1] != '-') {
DEBUG(0,("string_to_sid: Sid %s does not start with 'S-'.\n", sidstr));
return False;
}
- ZERO_STRUCTP(sidout);
+// ZERO_STRUCTP(sidout);
/* Get the revision number. */
p = sidstr + 2;