r11229: an even bigger speedup spotted by Volker. string_to_sid() is now taking...
authorJim McDonough <jmcd@samba.org>
Thu, 20 Oct 2005 16:05:12 +0000 (16:05 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:05:07 +0000 (11:05 -0500)
the time it used to.  Replace strcasecmp with invididual char checks for
"S-" sid prefix.
(This used to be commit de3d0094b78cb20da7ed958e8d3a428583694309)

source3/lib/util_sid.c

index cc1f55330fe49c96bacf191e73eccad4cd9ab2ad..0a9e6fe310ae0eb361733aeeea77d03ac31711d0 100644 (file)
@@ -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;