s3-lib Replace StrCaseCmp() with strcasecmp_m()
authorAndrew Bartlett <abartlet@samba.org>
Fri, 13 May 2011 18:21:30 +0000 (20:21 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 18 May 2011 14:12:08 +0000 (16:12 +0200)
strcasecmp_m() never needs to call to talloc, and via next_codepoint()
still has an ASCII fast-path bypassing iconv() calls.

Andrew Bartlett

51 files changed:
nsswitch/wins.c
source3/groupdb/mapping_tdb.c
source3/include/proto.h
source3/lib/adt_tree.c
source3/lib/filename_util.c
source3/lib/ms_fnmatch.c
source3/lib/smbldap.c
source3/lib/tldap_util.c
source3/lib/util.c
source3/lib/util_str.c
source3/libads/ldap.c
source3/libads/ldap_printer.c
source3/libnet/libnet_join.c
source3/librpc/rpc/dcerpc_ep.c
source3/libsmb/libsmb_xattr.c
source3/modules/onefs_streams.c
source3/modules/vfs_dirsort.c
source3/modules/vfs_streams_depot.c
source3/modules/vfs_streams_xattr.c
source3/nmbd/nmbd_elections.c
source3/printing/nt_printing.c
source3/registry/reg_backend_db.c
source3/registry/reg_parse_internal.c
source3/registry/regfio.c
source3/rpc_server/lsa/srv_lsa_nt.c
source3/rpc_server/rpc_ep_setup.c
source3/rpc_server/rpc_ncacn_np.c
source3/rpc_server/spoolss/srv_spoolss_nt.c
source3/rpc_server/srv_pipe_hnd.c
source3/rpcclient/cmd_samr.c
source3/rpcclient/cmd_spoolss.c
source3/rpcclient/rpcclient.c
source3/smbd/lanman.c
source3/smbd/server.c
source3/smbd/trans2.c
source3/torture/t_strcmp.c
source3/torture/torture.c
source3/utils/eventlogadm.c
source3/utils/net_ads.c
source3/utils/net_conf.c
source3/utils/net_file.c
source3/utils/net_group.c
source3/utils/net_groupmap.c
source3/utils/net_help.c
source3/utils/net_join.c
source3/utils/net_lookup.c
source3/utils/net_rpc.c
source3/utils/net_rpc_rights.c
source3/utils/net_share.c
source3/utils/net_user.c
source3/utils/net_util.c

index f5fd7a775e773e5374665bb1160ee4e585ec10f8..1bfdcd9fd58bcc4c1287483189a04c77e2fd57b8 100644 (file)
@@ -180,7 +180,7 @@ int lookup(nsd_file_t *rq)
         * response needs to be a string of the following format
         * ip_address[ ip_address]*\tname[ alias]*
         */
-       if (StrCaseCmp(map,"hosts.byaddr") == 0) {
+       if (strcasecmp_m(map,"hosts.byaddr") == 0) {
                if ( status = lookup_byaddr_backend(key, &count)) {
                    size = strlen(key) + 1;
                    if (size > len) {
@@ -208,7 +208,7 @@ int lookup(nsd_file_t *rq)
                    response[strlen(response)-1] = '\n';
                    talloc_free(status);
                }
-       } else if (StrCaseCmp(map,"hosts.byname") == 0) {
+       } else if (strcasecmp_m(map,"hosts.byname") == 0) {
            if (ip_list = lookup_byname_backend(key, &count)) {
                for (i = count; i ; i--) {
                    addr = inet_ntoa(ip_list[i-1]);
index a5fa1b7a249f8ba233bc171f032853566ce9df7d..1a6d4e152fc0aa5b3166224735c56f87df2608ab 100644 (file)
@@ -849,7 +849,7 @@ static int convert_ldb_record(TDB_CONTEXT *ltdb, TDB_DATA key,
                p += len + 1;
 
                num_vals = pull_uint32(p, 0);
-               if (StrCaseCmp(name, "member") == 0) {
+               if (strcasecmp_m(name, "member") == 0) {
                        num_mem = num_vals;
                        members = talloc_array(tmp_ctx, struct dom_sid, num_mem);
                        if (members == NULL) {
@@ -882,30 +882,30 @@ static int convert_ldb_record(TDB_CONTEXT *ltdb, TDB_DATA key,
 
                        /* we ignore unknown or uninteresting attributes
                         * (objectclass, etc.) */
-                       if (StrCaseCmp(name, "gidNumber") == 0) {
+                       if (strcasecmp_m(name, "gidNumber") == 0) {
                                map.gid = strtoul(val, &q, 10);
                                if (*q) {
                                        errno = EIO;
                                        goto failed;
                                }
-                       } else if (StrCaseCmp(name, "sid") == 0) {
+                       } else if (strcasecmp_m(name, "sid") == 0) {
                                if (!string_to_sid(&map.sid, val)) {
                                        errno = EIO;
                                        goto failed;
                                }
-                       } else if (StrCaseCmp(name, "sidNameUse") == 0) {
+                       } else if (strcasecmp_m(name, "sidNameUse") == 0) {
                                map.sid_name_use = strtoul(val, &q, 10);
                                if (*q) {
                                        errno = EIO;
                                        goto failed;
                                }
-                       } else if (StrCaseCmp(name, "ntname") == 0) {
+                       } else if (strcasecmp_m(name, "ntname") == 0) {
                                strlcpy(map.nt_name, val,
                                        sizeof(map.nt_name));
-                       } else if (StrCaseCmp(name, "comment") == 0) {
+                       } else if (strcasecmp_m(name, "comment") == 0) {
                                strlcpy(map.comment, val,
                                        sizeof(map.comment));
-                       } else if (StrCaseCmp(name, "member") == 0) {
+                       } else if (strcasecmp_m(name, "member") == 0) {
                                if (!string_to_sid(&members[j], val)) {
                                        errno = EIO;
                                        goto failed;
index 96ccd34345369b13c68ad6393f657304399d7617..e886c1f8bae4d99941394c9f010dac044aeed7d6 100644 (file)
@@ -871,7 +871,6 @@ ssize_t tstream_read_packet_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
 /* The following definitions come from lib/util_str.c  */
 
 bool next_token(const char **ptr, char *buff, const char *sep, size_t bufsize);
-int StrCaseCmp(const char *s, const char *t);
 int StrnCaseCmp(const char *s, const char *t, size_t len);
 bool strnequal(const char *s1,const char *s2,size_t n);
 bool strcsequal(const char *s1,const char *s2);
index 6d481613c7b93a6683a89b5a46fe753ebfbd4f2f..de7f2d2637277117a236df60bee78cf79bdd901d 100644 (file)
@@ -134,7 +134,7 @@ static struct tree_node *pathtree_birth_child(struct tree_node *node,
                        /* the strings should never match assuming that we 
                           have called pathtree_find_child() first */
 
-                       if ( StrCaseCmp( infant->key, node->children[i-1]->key ) > 0 ) {
+                       if ( strcasecmp_m( infant->key, node->children[i-1]->key ) > 0 ) {
                                DEBUG(11,("pathtree_birth_child: storing infant in i == [%d]\n", 
                                        i));
                                node->children[i] = infant;
@@ -183,7 +183,7 @@ static struct tree_node *pathtree_find_child(struct tree_node *node,
                DEBUG(11,("pathtree_find_child: child key => [%s]\n",
                        node->children[i]->key));
 
-               result = StrCaseCmp( node->children[i]->key, key );
+               result = strcasecmp_m( node->children[i]->key, key );
 
                if ( result == 0 )
                        next = node->children[i];
index d24660c981959dccff0b2d48ae7c75edd0e0be93..2405183d53bb08d7798c04f317894160aa73ea9b 100644 (file)
@@ -202,5 +202,5 @@ bool is_ntfs_default_stream_smb_fname(const struct smb_filename *smb_fname)
                return false;
        }
 
-       return StrCaseCmp(smb_fname->stream_name, "::$DATA") == 0;
+       return strcasecmp_m(smb_fname->stream_name, "::$DATA") == 0;
 }
index 272355b7d203d707c2aa943eba6c85480408fb86..f02354bfd7d68d874dcc565e990c6f0f1f46879a 100644 (file)
@@ -166,7 +166,7 @@ int ms_fnmatch(const char *pattern, const char *string, bool translate_pattern,
                if (is_case_sensitive) {
                        return strcmp(pattern, string);
                } else {
-                       return StrCaseCmp(pattern, string);
+                       return strcasecmp_m(pattern, string);
                }
        }
 
index d7d06e9e081f05088074073ebb3959a59c2bca94..fe383663d76e03fd9d13f0e00653de00c7afdd40 100644 (file)
@@ -405,7 +405,7 @@ ATTRIB_MAP_ENTRY sidmap_attr_list[] = {
                        return NULL;
                }
 
-               if (StrCaseCmp(tmp, result) < 0) {
+               if (strcasecmp_m(tmp, result) < 0) {
                        TALLOC_FREE(result);
                        result = tmp;
                } else {
@@ -654,7 +654,7 @@ static void smbldap_make_mod_internal(LDAP *ldap_struct, LDAPMessage *existing,
                        equal = (newblob && (data_blob_cmp(&oldblob, newblob) == 0));
                } else {
                        /* all of our string attributes are case insensitive */
-                       equal = (newval && (StrCaseCmp(oldval, newval) == 0));
+                       equal = (newval && (strcasecmp_m(oldval, newval) == 0));
                }
 
                if (equal) {
index e4cb5f040bfd625c3a175b41c8419c89526e9cb2..6b9f912e277954aca234330d2b7966d86c3a04f5 100644 (file)
@@ -300,7 +300,7 @@ static int compare_utf8_blobs(const DATA_BLOB *d1, const DATA_BLOB *d2)
                TALLOC_FREE(s1);
                return 0;
        }
-       ret = StrCaseCmp(s1, s2);
+       ret = strcasecmp_m(s1, s2);
        TALLOC_FREE(s2);
        TALLOC_FREE(s1);
        return ret;
index 8d90569863f4de88b55a7a8c528d5f9f75fcac82..ee696461c6bf0a32eaee6ff347457246f2593ba1 100644 (file)
@@ -1299,7 +1299,7 @@ bool is_in_path(const char *name, name_compare_entry *namelist, bool case_sensit
                        }
                } else {
                        if((case_sensitive && (strcmp(last_component, namelist->name) == 0))||
-                                               (!case_sensitive && (StrCaseCmp(last_component, namelist->name) == 0))) {
+                                               (!case_sensitive && (strcasecmp_m(last_component, namelist->name) == 0))) {
                                DEBUG(8,("is_in_path: match succeeded\n"));
                                return True;
                        }
@@ -2203,7 +2203,7 @@ bool name_to_fqdn(fstring fqdn, const char *name)
                        }
                }
        }
-       if (full && (StrCaseCmp(full, "localhost.localdomain") == 0)) {
+       if (full && (strcasecmp_m(full, "localhost.localdomain") == 0)) {
                DEBUG(1, ("WARNING: your /etc/hosts file may be broken!\n"));
                DEBUGADD(1, ("    Specifing the machine hostname for address 127.0.0.1 may lead\n"));
                DEBUGADD(1, ("    to Kerberos authentication problems as localhost.localdomain\n"));
index 3dc73d9b8e3fa85db79b9e9648991a10a5923512..ee36930fd1ec94a95bd1e11e1ffae3b8e2066f78 100644 (file)
@@ -35,89 +35,6 @@ const char toupper_ascii_fast_table[128] = {
        0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f
 };
 
-/**
- * Case insensitive string compararison.
- *
- * iconv does not directly give us a way to compare strings in
- * arbitrary unix character sets -- all we can is convert and then
- * compare.  This is expensive.
- *
- * As an optimization, we do a first pass that considers only the
- * prefix of the strings that is entirely 7-bit.  Within this, we
- * check whether they have the same value.
- *
- * Hopefully this will often give the answer without needing to copy.
- * In particular it should speed comparisons to literal ascii strings
- * or comparisons of strings that are "obviously" different.
- *
- * If we find a non-ascii character we fall back to converting via
- * iconv.
- *
- * This should never be slower than convering the whole thing, and
- * often faster.
- *
- * A different optimization would be to compare for bitwise equality
- * in the binary encoding.  (It would be possible thought hairy to do
- * both simultaneously.)  But in that case if they turn out to be
- * different, we'd need to restart the whole thing.
- *
- * Even better is to implement strcasecmp for each encoding and use a
- * function pointer.
- **/
-int StrCaseCmp(const char *s, const char *t)
-{
-
-       const char *ps, *pt;
-       size_t size;
-       smb_ucs2_t *buffer_s, *buffer_t;
-       int ret;
-
-       for (ps = s, pt = t; ; ps++, pt++) {
-               char us, ut;
-
-               if (!*ps && !*pt)
-                       return 0; /* both ended */
-               else if (!*ps)
-                       return -1; /* s is a prefix */
-               else if (!*pt)
-                       return +1; /* t is a prefix */
-               else if ((*ps & 0x80) || (*pt & 0x80))
-                       /* not ascii anymore, do it the hard way
-                        * from here on in */
-                       break;
-
-               us = toupper_ascii_fast(*ps);
-               ut = toupper_ascii_fast(*pt);
-               if (us == ut)
-                       continue;
-               else if (us < ut)
-                       return -1;
-               else if (us > ut)
-                       return +1;
-       }
-
-       if (!push_ucs2_talloc(talloc_tos(), &buffer_s, ps, &size)) {
-               return strcmp(ps, pt);
-               /* Not quite the right answer, but finding the right one
-                  under this failure case is expensive, and it's pretty
-                  close */
-       }
-
-       if (!push_ucs2_talloc(talloc_tos(), &buffer_t, pt, &size)) {
-               TALLOC_FREE(buffer_s);
-               return strcmp(ps, pt);
-               /* Not quite the right answer, but finding the right one
-                  under this failure case is expensive, and it's pretty
-                  close */
-       }
-
-       ret = strcasecmp_w(buffer_s, buffer_t);
-       TALLOC_FREE(buffer_s);
-       TALLOC_FREE(buffer_t);
-       return ret;
-}
-
-
 /**
  Case insensitive string compararison, length limited.
 **/
@@ -360,7 +277,7 @@ bool in_list(const char *s, const char *list, bool casesensitive)
                                break;
                        }
                } else {
-                       if (StrCaseCmp(tok,s) == 0) {
+                       if (strcasecmp_m(tok,s) == 0) {
                                ret = true;
                                break;
                        }
index 893e1411f0b07ce23bbbef9656366bf86d346596..19cb3ad2d61f57e341742a46428d0690268edcb4 100644 (file)
@@ -2228,7 +2228,7 @@ static bool ads_dump_field(ADS_STRUCT *ads, char *field, void **values, void *da
        }
 
        for (i=0; handlers[i].name; i++) {
-               if (StrCaseCmp(handlers[i].name, field) == 0) {
+               if (strcasecmp_m(handlers[i].name, field) == 0) {
                        if (!values) /* first time, indicate string or not */
                                return handlers[i].string;
                        handlers[i].handler(ads, field, (struct berval **) values);
index 664da8a60dcad9eca178aae8357f19b69fd2b849..3e3ea258405ad1dad0015355adaf1aea087397c7 100644 (file)
@@ -289,7 +289,7 @@ static void map_regval_to_ads(TALLOC_CTX *ctx, ADS_MODLIST *mods,
        int i;
 
        for (i=0; map[i].valname; i++) {
-               if (StrCaseCmp(map[i].valname, regval_name(value)) == 0) {
+               if (strcasecmp_m(map[i].valname, regval_name(value)) == 0) {
                        if (!map[i].fn(ctx, mods, value)) {
                                DEBUG(5, ("Add of value %s to modlist failed\n", regval_name(value)));
                        } else {
index 6750120fc990aabdf15ec785b189908131026312..4f67e51fc2bfb3b11a03b6f4620292e816f6037b 100644 (file)
@@ -1771,7 +1771,7 @@ static int libnet_destroy_JoinCtx(struct libnet_JoinCtx *r)
        }
 
        krb5_cc_env = getenv(KRB5_ENV_CCNAME);
-       if (krb5_cc_env && StrCaseCmp(krb5_cc_env, "MEMORY:libnetjoin")) {
+       if (krb5_cc_env && strcasecmp_m(krb5_cc_env, "MEMORY:libnetjoin")) {
                unsetenv(KRB5_ENV_CCNAME);
        }
 
@@ -1790,7 +1790,7 @@ static int libnet_destroy_UnjoinCtx(struct libnet_UnjoinCtx *r)
        }
 
        krb5_cc_env = getenv(KRB5_ENV_CCNAME);
-       if (krb5_cc_env && StrCaseCmp(krb5_cc_env, "MEMORY:libnetjoin")) {
+       if (krb5_cc_env && strcasecmp_m(krb5_cc_env, "MEMORY:libnetjoin")) {
                unsetenv(KRB5_ENV_CCNAME);
        }
 
index 5ed71857bc3ab157d792422f0f6fde061eb23c71..5088e7efcf1697b45f1ade264ba668f5addc2bc5 100644 (file)
@@ -169,7 +169,7 @@ static NTSTATUS ep_register(TALLOC_CTX *mem_ctx,
                                           "rpc_server", "epmapper",
                                           "none");
 
-       if (StrCaseCmp(rpcsrv_type, "embedded") == 0) {
+       if (strcasecmp_m(rpcsrv_type, "embedded") == 0) {
                static struct client_address client_id;
 
                strlcpy(client_id.addr, "localhost", sizeof(client_id.addr));
@@ -186,7 +186,7 @@ static NTSTATUS ep_register(TALLOC_CTX *mem_ctx,
                                  "epmapper (%s)", nt_errstr(status)));
                        goto done;
                }
-       } else if (StrCaseCmp(rpcsrv_type, "daemon") == 0) {
+       } else if (strcasecmp_m(rpcsrv_type, "daemon") == 0) {
                /* Connect to the endpoint mapper locally */
                ncalrpc_sock = talloc_asprintf(tmp_ctx,
                                              "%s/%s",
index 583179daa0d663cee4621702e517c6742f6afaa0..22d71571c6ae1c66c45062d1eaefe91943e5aa0a 100644 (file)
@@ -822,48 +822,48 @@ cacl_get(SMBCCTX *context,
                         }
 
                         /* Which exclusion name is this? */
-                        if (StrCaseCmp(pExclude,
+                        if (strcasecmp_m(pExclude,
                                        "nt_sec_desc.revision") == 0) {
                                 exclude_nt_revision = True;
                         }
-                        else if (StrCaseCmp(pExclude,
+                        else if (strcasecmp_m(pExclude,
                                             "nt_sec_desc.owner") == 0) {
                                 exclude_nt_owner = True;
                         }
-                        else if (StrCaseCmp(pExclude,
+                        else if (strcasecmp_m(pExclude,
                                             "nt_sec_desc.group") == 0) {
                                 exclude_nt_group = True;
                         }
-                        else if (StrCaseCmp(pExclude,
+                        else if (strcasecmp_m(pExclude,
                                             "nt_sec_desc.acl") == 0) {
                                 exclude_nt_acl = True;
                         }
-                        else if (StrCaseCmp(pExclude,
+                        else if (strcasecmp_m(pExclude,
                                             "dos_attr.mode") == 0) {
                                 exclude_dos_mode = True;
                         }
-                        else if (StrCaseCmp(pExclude,
+                        else if (strcasecmp_m(pExclude,
                                             "dos_attr.size") == 0) {
                                 exclude_dos_size = True;
                         }
                         else if (excl_attr_strings.create_time_attr != NULL &&
-                                 StrCaseCmp(pExclude,
+                                 strcasecmp_m(pExclude,
                                             excl_attr_strings.change_time_attr) == 0) {
                                 exclude_dos_create_time = True;
                         }
-                        else if (StrCaseCmp(pExclude,
+                        else if (strcasecmp_m(pExclude,
                                             excl_attr_strings.access_time_attr) == 0) {
                                 exclude_dos_access_time = True;
                         }
-                        else if (StrCaseCmp(pExclude,
+                        else if (strcasecmp_m(pExclude,
                                             excl_attr_strings.write_time_attr) == 0) {
                                 exclude_dos_write_time = True;
                         }
-                        else if (StrCaseCmp(pExclude,
+                        else if (strcasecmp_m(pExclude,
                                             excl_attr_strings.change_time_attr) == 0) {
                                 exclude_dos_change_time = True;
                         }
-                        else if (StrCaseCmp(pExclude, "dos_attr.inode") == 0) {
+                        else if (strcasecmp_m(pExclude, "dos_attr.inode") == 0) {
                                 exclude_dos_inode = True;
                         }
                         else {
@@ -933,7 +933,7 @@ cacl_get(SMBCCTX *context,
                                                      "REVISION:%d",
                                                      sd->revision);
                                 }
-                        } else if (StrCaseCmp(name, "revision") == 0) {
+                        } else if (strcasecmp_m(name, "revision") == 0) {
                                 if (determine_size) {
                                         p = talloc_asprintf(ctx, "%d",
                                                             sd->revision);
@@ -1086,9 +1086,9 @@ cacl_get(SMBCCTX *context,
                                                         ace->access_mask);
                                         }
                                 } else if ((StrnCaseCmp(name, "acl", 3) == 0 &&
-                                            StrCaseCmp(name+3, sidstr) == 0) ||
+                                            strcasecmp_m(name+3, sidstr) == 0) ||
                                            (StrnCaseCmp(name, "acl+", 4) == 0 &&
-                                            StrCaseCmp(name+4, sidstr) == 0)) {
+                                            strcasecmp_m(name+4, sidstr) == 0)) {
                                         if (determine_size) {
                                                 p = talloc_asprintf(
                                                         ctx, 
@@ -1193,7 +1193,7 @@ cacl_get(SMBCCTX *context,
                                                       : ""),
                                                      mode);
                                 }
-                        } else if (StrCaseCmp(name, "mode") == 0) {
+                        } else if (strcasecmp_m(name, "mode") == 0) {
                                 if (determine_size) {
                                         p = talloc_asprintf(ctx, "0x%x", mode);
                                         if (!p) {
@@ -1234,7 +1234,7 @@ cacl_get(SMBCCTX *context,
                                                      ",SIZE:%.0f",
                                                      (double)size);
                                 }
-                        } else if (StrCaseCmp(name, "size") == 0) {
+                        } else if (strcasecmp_m(name, "size") == 0) {
                                 if (determine_size) {
                                         p = talloc_asprintf(
                                                 ctx,
@@ -1281,7 +1281,7 @@ cacl_get(SMBCCTX *context,
                                                      attr_strings.create_time_attr,
                                                      (unsigned long) create_time);
                                 }
-                        } else if (StrCaseCmp(name, attr_strings.create_time_attr) == 0) {
+                        } else if (strcasecmp_m(name, attr_strings.create_time_attr) == 0) {
                                 if (determine_size) {
                                         p = talloc_asprintf(ctx, "%lu", (unsigned long) create_time);
                                         if (!p) {
@@ -1323,7 +1323,7 @@ cacl_get(SMBCCTX *context,
                                                      attr_strings.access_time_attr,
                                                      (unsigned long) access_time);
                                 }
-                        } else if (StrCaseCmp(name, attr_strings.access_time_attr) == 0) {
+                        } else if (strcasecmp_m(name, attr_strings.access_time_attr) == 0) {
                                 if (determine_size) {
                                         p = talloc_asprintf(ctx, "%lu", (unsigned long) access_time);
                                         if (!p) {
@@ -1365,7 +1365,7 @@ cacl_get(SMBCCTX *context,
                                                      attr_strings.write_time_attr,
                                                      (unsigned long) write_time);
                                 }
-                        } else if (StrCaseCmp(name, attr_strings.write_time_attr) == 0) {
+                        } else if (strcasecmp_m(name, attr_strings.write_time_attr) == 0) {
                                 if (determine_size) {
                                         p = talloc_asprintf(ctx, "%lu", (unsigned long) write_time);
                                         if (!p) {
@@ -1407,7 +1407,7 @@ cacl_get(SMBCCTX *context,
                                                      attr_strings.change_time_attr,
                                                      (unsigned long) change_time);
                                 }
-                        } else if (StrCaseCmp(name, attr_strings.change_time_attr) == 0) {
+                        } else if (strcasecmp_m(name, attr_strings.change_time_attr) == 0) {
                                 if (determine_size) {
                                         p = talloc_asprintf(ctx, "%lu", (unsigned long) change_time);
                                         if (!p) {
@@ -1448,7 +1448,7 @@ cacl_get(SMBCCTX *context,
                                                      ",INODE:%.0f",
                                                      (double) ino);
                                 }
-                        } else if (StrCaseCmp(name, "inode") == 0) {
+                        } else if (strcasecmp_m(name, "inode") == 0) {
                                 if (determine_size) {
                                         p = talloc_asprintf(
                                                 ctx,
@@ -1775,8 +1775,8 @@ SMBC_setxattr_ctx(SMBCCTX *context,
         /*
          * Are they asking to set the entire set of known attributes?
          */
-        if (StrCaseCmp(name, "system.*") == 0 ||
-            StrCaseCmp(name, "system.*+") == 0) {
+        if (strcasecmp_m(name, "system.*") == 0 ||
+            strcasecmp_m(name, "system.*+") == 0) {
                 /* Yup. */
                 char *namevalue =
                         talloc_asprintf(talloc_tos(), "%s:%s",
@@ -1835,9 +1835,9 @@ SMBC_setxattr_ctx(SMBCCTX *context,
          * Are they asking to set an access control element or to set
          * the entire access control list?
          */
-        if (StrCaseCmp(name, "system.nt_sec_desc.*") == 0 ||
-            StrCaseCmp(name, "system.nt_sec_desc.*+") == 0 ||
-            StrCaseCmp(name, "system.nt_sec_desc.revision") == 0 ||
+        if (strcasecmp_m(name, "system.nt_sec_desc.*") == 0 ||
+            strcasecmp_m(name, "system.nt_sec_desc.*+") == 0 ||
+            strcasecmp_m(name, "system.nt_sec_desc.revision") == 0 ||
             StrnCaseCmp(name, "system.nt_sec_desc.acl", 22) == 0 ||
             StrnCaseCmp(name, "system.nt_sec_desc.acl+", 23) == 0) {
 
@@ -1868,8 +1868,8 @@ SMBC_setxattr_ctx(SMBCCTX *context,
         /*
          * Are they asking to set the owner?
          */
-        if (StrCaseCmp(name, "system.nt_sec_desc.owner") == 0 ||
-            StrCaseCmp(name, "system.nt_sec_desc.owner+") == 0) {
+        if (strcasecmp_m(name, "system.nt_sec_desc.owner") == 0 ||
+            strcasecmp_m(name, "system.nt_sec_desc.owner+") == 0) {
 
                 /* Yup. */
                 char *namevalue =
@@ -1894,8 +1894,8 @@ SMBC_setxattr_ctx(SMBCCTX *context,
         /*
          * Are they asking to set the group?
          */
-        if (StrCaseCmp(name, "system.nt_sec_desc.group") == 0 ||
-            StrCaseCmp(name, "system.nt_sec_desc.group+") == 0) {
+        if (strcasecmp_m(name, "system.nt_sec_desc.group") == 0 ||
+            strcasecmp_m(name, "system.nt_sec_desc.group+") == 0) {
 
                 /* Yup. */
                 char *namevalue =
@@ -1936,13 +1936,13 @@ SMBC_setxattr_ctx(SMBCCTX *context,
         /*
          * Are they asking to set a DOS attribute?
          */
-        if (StrCaseCmp(name, "system.dos_attr.*") == 0 ||
-            StrCaseCmp(name, "system.dos_attr.mode") == 0 ||
+        if (strcasecmp_m(name, "system.dos_attr.*") == 0 ||
+            strcasecmp_m(name, "system.dos_attr.mode") == 0 ||
             (attr_strings.create_time_attr != NULL &&
-             StrCaseCmp(name, attr_strings.create_time_attr) == 0) ||
-            StrCaseCmp(name, attr_strings.access_time_attr) == 0 ||
-            StrCaseCmp(name, attr_strings.write_time_attr) == 0 ||
-            StrCaseCmp(name, attr_strings.change_time_attr) == 0) {
+             strcasecmp_m(name, attr_strings.create_time_attr) == 0) ||
+            strcasecmp_m(name, attr_strings.access_time_attr) == 0 ||
+            strcasecmp_m(name, attr_strings.write_time_attr) == 0 ||
+            strcasecmp_m(name, attr_strings.change_time_attr) == 0) {
 
                 /* get a DOS Attribute Descriptor with current attributes */
                 dad = dos_attr_query(context, talloc_tos(), path, srv);
@@ -2081,31 +2081,31 @@ SMBC_getxattr_ctx(SMBCCTX *context,
         }
 
         /* Are they requesting a supported attribute? */
-        if (StrCaseCmp(name, "system.*") == 0 ||
+        if (strcasecmp_m(name, "system.*") == 0 ||
             StrnCaseCmp(name, "system.*!", 9) == 0 ||
-            StrCaseCmp(name, "system.*+") == 0 ||
+            strcasecmp_m(name, "system.*+") == 0 ||
             StrnCaseCmp(name, "system.*+!", 10) == 0 ||
-            StrCaseCmp(name, "system.nt_sec_desc.*") == 0 ||
+            strcasecmp_m(name, "system.nt_sec_desc.*") == 0 ||
             StrnCaseCmp(name, "system.nt_sec_desc.*!", 21) == 0 ||
-            StrCaseCmp(name, "system.nt_sec_desc.*+") == 0 ||
+            strcasecmp_m(name, "system.nt_sec_desc.*+") == 0 ||
             StrnCaseCmp(name, "system.nt_sec_desc.*+!", 22) == 0 ||
-            StrCaseCmp(name, "system.nt_sec_desc.revision") == 0 ||
-            StrCaseCmp(name, "system.nt_sec_desc.owner") == 0 ||
-            StrCaseCmp(name, "system.nt_sec_desc.owner+") == 0 ||
-            StrCaseCmp(name, "system.nt_sec_desc.group") == 0 ||
-            StrCaseCmp(name, "system.nt_sec_desc.group+") == 0 ||
+            strcasecmp_m(name, "system.nt_sec_desc.revision") == 0 ||
+            strcasecmp_m(name, "system.nt_sec_desc.owner") == 0 ||
+            strcasecmp_m(name, "system.nt_sec_desc.owner+") == 0 ||
+            strcasecmp_m(name, "system.nt_sec_desc.group") == 0 ||
+            strcasecmp_m(name, "system.nt_sec_desc.group+") == 0 ||
             StrnCaseCmp(name, "system.nt_sec_desc.acl", 22) == 0 ||
             StrnCaseCmp(name, "system.nt_sec_desc.acl+", 23) == 0 ||
-            StrCaseCmp(name, "system.dos_attr.*") == 0 ||
+            strcasecmp_m(name, "system.dos_attr.*") == 0 ||
             StrnCaseCmp(name, "system.dos_attr.*!", 18) == 0 ||
-            StrCaseCmp(name, "system.dos_attr.mode") == 0 ||
-            StrCaseCmp(name, "system.dos_attr.size") == 0 ||
+            strcasecmp_m(name, "system.dos_attr.mode") == 0 ||
+            strcasecmp_m(name, "system.dos_attr.size") == 0 ||
             (attr_strings.create_time_attr != NULL &&
-             StrCaseCmp(name, attr_strings.create_time_attr) == 0) ||
-            StrCaseCmp(name, attr_strings.access_time_attr) == 0 ||
-            StrCaseCmp(name, attr_strings.write_time_attr) == 0 ||
-            StrCaseCmp(name, attr_strings.change_time_attr) == 0 ||
-            StrCaseCmp(name, "system.dos_attr.inode") == 0) {
+             strcasecmp_m(name, attr_strings.create_time_attr) == 0) ||
+            strcasecmp_m(name, attr_strings.access_time_attr) == 0 ||
+            strcasecmp_m(name, attr_strings.write_time_attr) == 0 ||
+            strcasecmp_m(name, attr_strings.change_time_attr) == 0 ||
+            strcasecmp_m(name, "system.dos_attr.inode") == 0) {
 
                 /* Yup. */
                 const char *filename = name;
@@ -2206,8 +2206,8 @@ SMBC_removexattr_ctx(SMBCCTX *context,
         }
 
         /* Are they asking to set the entire ACL? */
-        if (StrCaseCmp(name, "system.nt_sec_desc.*") == 0 ||
-            StrCaseCmp(name, "system.nt_sec_desc.*+") == 0) {
+        if (strcasecmp_m(name, "system.nt_sec_desc.*") == 0 ||
+            strcasecmp_m(name, "system.nt_sec_desc.*+") == 0) {
 
                 /* Yup. */
                 ret = cacl_set(context, talloc_tos(), srv->cli,
@@ -2221,11 +2221,11 @@ SMBC_removexattr_ctx(SMBCCTX *context,
          * Are they asking to remove one or more spceific security descriptor
          * attributes?
          */
-        if (StrCaseCmp(name, "system.nt_sec_desc.revision") == 0 ||
-            StrCaseCmp(name, "system.nt_sec_desc.owner") == 0 ||
-            StrCaseCmp(name, "system.nt_sec_desc.owner+") == 0 ||
-            StrCaseCmp(name, "system.nt_sec_desc.group") == 0 ||
-            StrCaseCmp(name, "system.nt_sec_desc.group+") == 0 ||
+        if (strcasecmp_m(name, "system.nt_sec_desc.revision") == 0 ||
+            strcasecmp_m(name, "system.nt_sec_desc.owner") == 0 ||
+            strcasecmp_m(name, "system.nt_sec_desc.owner+") == 0 ||
+            strcasecmp_m(name, "system.nt_sec_desc.group") == 0 ||
+            strcasecmp_m(name, "system.nt_sec_desc.group+") == 0 ||
             StrnCaseCmp(name, "system.nt_sec_desc.acl", 22) == 0 ||
             StrnCaseCmp(name, "system.nt_sec_desc.acl+", 23) == 0) {
 
index 85ab25683f3eb60e343513256d0dab113f276213..2634ea77a1d21b3b8eea37b2b166bc9cd31c81b6 100644 (file)
@@ -56,7 +56,7 @@ NTSTATUS onefs_stream_prep_smb_fname(TALLOC_CTX *ctx,
                /* Strip off the :$DATA if one exists. */
                str_tmp = strrchr_m(stream_name, ':');
                if (str_tmp) {
-                       if (StrCaseCmp(str_tmp, ":$DATA") != 0) {
+                       if (strcasecmp_m(str_tmp, ":$DATA") != 0) {
                                return NT_STATUS_INVALID_PARAMETER;
                        }
                        str_tmp[0] = '\0';
index adeab0425d574a8cb411cfd72b89644451cfe698..ba8441c2dff078692e0c2f8d53401099ddde4764 100644 (file)
@@ -24,7 +24,7 @@
 
 static int compare_dirent (const SMB_STRUCT_DIRENT *da, const SMB_STRUCT_DIRENT *db)
 {
-       return StrCaseCmp(da->d_name, db->d_name);
+       return strcasecmp_m(da->d_name, db->d_name);
 }
 
 struct dirsort_privates {
index 01851cd2f83340efde22a22c84289752a6207091..f1c687e9528b41613a77e2e4b47814628a0c37e2 100644 (file)
@@ -324,7 +324,7 @@ static NTSTATUS stream_smb_fname(vfs_handle_struct *handle,
        stype = strchr_m(smb_fname->stream_name + 1, ':');
 
        if (stype) {
-               if (StrCaseCmp(stype, ":$DATA") != 0) {
+               if (strcasecmp_m(stype, ":$DATA") != 0) {
                        return NT_STATUS_INVALID_PARAMETER;
                }
        }
index 0a56b55806dd3393cdd35279a9ae469594f29f3c..3a001e445c24b39bff96aae0b0164458a5cfc28e 100644 (file)
@@ -614,7 +614,7 @@ static int streams_xattr_rename(vfs_handle_struct *handle,
        }
 
        /* Don't rename if the streams are identical. */
-       if (StrCaseCmp(smb_fname_src->stream_name,
+       if (strcasecmp_m(smb_fname_src->stream_name,
                       smb_fname_dst->stream_name) == 0) {
                goto done;
        }
index a7b240f05e3c2d12dc7c2aa922336c6a52eed311..4340f66096541ef644cc12917c9fcf7b27025ad8 100644 (file)
@@ -248,7 +248,7 @@ static bool win_election(struct work_record *work, int version,
        if (timeup < mytimeup)
                return(True);
 
-       if (StrCaseCmp(global_myname(), server_name) > 0)
+       if (strcasecmp_m(global_myname(), server_name) > 0)
                return(False);
   
        return(True);
index 6d4bebbdf5776d95176a5e3835d5e2e9fc167087..76fb6fd6dee4f39be703b3f134e9a01a764edeee 100644 (file)
@@ -147,7 +147,7 @@ const char *get_short_archi(const char *long_archi)
         do {
                 i++;
         } while ( (archi_table[i].long_archi!=NULL ) &&
-                  StrCaseCmp(long_archi, archi_table[i].long_archi) );
+                  strcasecmp_m(long_archi, archi_table[i].long_archi) );
 
         if (archi_table[i].long_archi==NULL) {
                 DEBUGADD(10,("Unknown architecture [%s] !\n", long_archi));
index 11bbe7ed36a30d1bbb3c7b317c66b27751f1ef2b..1db745d962a5e0c250389dba059c148954c17273 100644 (file)
@@ -1300,7 +1300,7 @@ done:
 
 static int cmp_keynames(char **p1, char **p2)
 {
-       return StrCaseCmp(*p1, *p2);
+       return strcasecmp_m(*p1, *p2);
 }
 
 struct create_sorted_subkeys_context {
index dedbe123d864139a3bc7fa321b2ccc513afb7991..721a19c112dc5d1828588c1ec935c7cfd546e71f 100644 (file)
@@ -308,7 +308,7 @@ int write_bom(FILE* file, const char* charset, charset_t ctype)
                DEBUG(0, ("No Byte Order Mark for charset_t: %u\n", (unsigned)ctype));
        } else {
                for (i=0; BOM[i].name; i++) {
-                       if (StrCaseCmp(BOM[i].name, charset) == 0) {
+                       if (strcasecmp_m(BOM[i].name, charset) == 0) {
                                return fwrite(BOM[i].seq, 1, BOM[i].len, file);
                        }
                }
index bd5380787c6b14e52d92b556300156f1317b9a7e..c4d2a6d4d340b4304c9ebd83cb97ceb400107a10 100644 (file)
@@ -1750,7 +1750,7 @@ static bool create_vk_record(REGF_FILE *file, REGF_VK_REC *vk,
 
 static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 )
 {
-       return StrCaseCmp( h1->fullname, h2->fullname );
+       return strcasecmp_m( h1->fullname, h2->fullname );
 }
 
 /*******************************************************************
index 341bd5d424ff6492ae814082c5e4e85144e5c2ea..da0f697dc9815c789e1617af0120a0bc5c2b42f4 100644 (file)
@@ -3488,7 +3488,7 @@ static int dns_cmp(const char *s1, size_t l1,
        int cret;
 
        if (l1 == l2) {
-               if (StrCaseCmp(s1, s2) == 0) {
+               if (strcasecmp_m(s1, s2) == 0) {
                        return DNS_CMP_MATCH;
                }
                return DNS_CMP_NO_MATCH;
@@ -3512,7 +3512,7 @@ static int dns_cmp(const char *s1, size_t l1,
                return DNS_CMP_NO_MATCH;
        }
 
-       if (StrCaseCmp(&p1[t1 - t2], p2) == 0) {
+       if (strcasecmp_m(&p1[t1 - t2], p2) == 0) {
                return cret;
        }
 
@@ -3701,7 +3701,7 @@ static NTSTATUS check_ft_info(TALLOC_CTX *mem_ctx,
                                sid_conflict = true;
                        }
                        if (!(trec->flags & LSA_NB_DISABLED_ADMIN) &&
-                           StrCaseCmp(trec->data.info.netbios_name.string,
+                           strcasecmp_m(trec->data.info.netbios_name.string,
                                       nb_name) == 0) {
                                nb_conflict = true;
                        }
@@ -3876,7 +3876,7 @@ NTSTATUS _lsa_lsaRSetForestTrustInformation(struct pipes_struct *p,
                if (domains[i]->domain_name == NULL) {
                        return NT_STATUS_INVALID_DOMAIN_STATE;
                }
-               if (StrCaseCmp(domains[i]->domain_name,
+               if (strcasecmp_m(domains[i]->domain_name,
                               r->in.trusted_domain_name->string) == 0) {
                        break;
                }
index d00b35161c61a54992252a96c29389c8aecd9c5c..2dc54bd812c8cf2091aaf9f1fa528f77d3785dde 100644 (file)
@@ -423,8 +423,8 @@ static bool winreg_init_cb(void *ptr)
                                           "epmapper",
                                           "none");
 
-       if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
-           StrCaseCmp(rpcsrv_type, "daemon") == 0) {
+       if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
+           strcasecmp_m(rpcsrv_type, "daemon") == 0) {
                NTSTATUS status;
                bool ok;
 
@@ -471,8 +471,8 @@ static bool srvsvc_init_cb(void *ptr)
                                           "epmapper",
                                           "none");
 
-       if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
-           StrCaseCmp(rpcsrv_type, "daemon") == 0) {
+       if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
+           strcasecmp_m(rpcsrv_type, "daemon") == 0) {
                NTSTATUS status;
                bool ok;
 
@@ -520,8 +520,8 @@ static bool lsarpc_init_cb(void *ptr)
                                           "epmapper",
                                           "none");
 
-       if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
-           StrCaseCmp(rpcsrv_type, "daemon") == 0) {
+       if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
+           strcasecmp_m(rpcsrv_type, "daemon") == 0) {
                NTSTATUS status;
                bool ok;
 
@@ -569,8 +569,8 @@ static bool samr_init_cb(void *ptr)
                                           "epmapper",
                                           "none");
 
-       if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
-           StrCaseCmp(rpcsrv_type, "daemon") == 0) {
+       if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
+           strcasecmp_m(rpcsrv_type, "daemon") == 0) {
                NTSTATUS status;
                bool ok;
 
@@ -618,8 +618,8 @@ static bool netlogon_init_cb(void *ptr)
                                           "epmapper",
                                           "none");
 
-       if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
-           StrCaseCmp(rpcsrv_type, "daemon") == 0) {
+       if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
+           strcasecmp_m(rpcsrv_type, "daemon") == 0) {
                NTSTATUS status;
                bool ok;
 
@@ -673,8 +673,8 @@ static bool spoolss_init_cb(void *ptr)
                return false;
        }
 
-       if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
-           StrCaseCmp(rpcsrv_type, "daemon") == 0) {
+       if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
+           strcasecmp_m(rpcsrv_type, "daemon") == 0) {
                NTSTATUS status;
 
                status =rpc_ep_setup_register(ep_ctx->ev_ctx,
@@ -717,8 +717,8 @@ static bool svcctl_init_cb(void *ptr)
        /* initialize the control hooks */
        init_service_op_table();
 
-       if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
-           StrCaseCmp(rpcsrv_type, "daemon") == 0) {
+       if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
+           strcasecmp_m(rpcsrv_type, "daemon") == 0) {
                NTSTATUS status;
 
                status = rpc_ep_setup_register(ep_ctx->ev_ctx,
@@ -752,8 +752,8 @@ static bool ntsvcs_init_cb(void *ptr)
                                           "epmapper",
                                           "none");
 
-       if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
-           StrCaseCmp(rpcsrv_type, "daemon") == 0) {
+       if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
+           strcasecmp_m(rpcsrv_type, "daemon") == 0) {
                NTSTATUS status;
 
                status = rpc_ep_setup_register(ep_ctx->ev_ctx,
@@ -786,8 +786,8 @@ static bool eventlog_init_cb(void *ptr)
                return false;
        }
 
-       if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
-           StrCaseCmp(rpcsrv_type, "daemon") == 0) {
+       if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
+           strcasecmp_m(rpcsrv_type, "daemon") == 0) {
                NTSTATUS status;
 
                status =rpc_ep_setup_register(ep_ctx->ev_ctx,
@@ -814,8 +814,8 @@ static bool initshutdown_init_cb(void *ptr)
                                           "epmapper",
                                           "none");
 
-       if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
-           StrCaseCmp(rpcsrv_type, "daemon") == 0) {
+       if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
+           strcasecmp_m(rpcsrv_type, "daemon") == 0) {
                NTSTATUS status;
 
                status = rpc_ep_setup_register(ep_ctx->ev_ctx,
@@ -843,8 +843,8 @@ static bool rpcecho_init_cb(void *ptr) {
                                           "epmapper",
                                           "none");
 
-       if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
-           StrCaseCmp(rpcsrv_type, "daemon") == 0) {
+       if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
+           strcasecmp_m(rpcsrv_type, "daemon") == 0) {
                NTSTATUS status;
 
                port = _open_sockets(ep_ctx->ev_ctx,
@@ -883,8 +883,8 @@ static bool netdfs_init_cb(void *ptr)
                                           "rpc_server",
                                           "epmapper",
                                           "none");
-       if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
-           StrCaseCmp(rpcsrv_type, "daemon") == 0) {
+       if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
+           strcasecmp_m(rpcsrv_type, "daemon") == 0) {
                NTSTATUS status;
                bool ok;
 
@@ -932,8 +932,8 @@ static bool dssetup_init_cb(void *ptr)
                                           "epmapper",
                                           "none");
 
-       if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
-           StrCaseCmp(rpcsrv_type, "daemon") == 0) {
+       if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
+           strcasecmp_m(rpcsrv_type, "daemon") == 0) {
                NTSTATUS status;
                bool ok;
 
@@ -980,8 +980,8 @@ static bool wkssvc_init_cb(void *ptr)
                                           "rpc_server",
                                           "epmapper",
                                           "none");
-       if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
-           StrCaseCmp(rpcsrv_type, "daemon") == 0) {
+       if (strcasecmp_m(rpcsrv_type, "embedded") == 0 ||
+           strcasecmp_m(rpcsrv_type, "daemon") == 0) {
                NTSTATUS status;
                bool ok;
 
@@ -1056,7 +1056,7 @@ bool dcesrv_ep_setup(struct tevent_context *ev_ctx,
                                           "rpc_server",
                                           "epmapper",
                                           "none");
-       if (StrCaseCmp(rpcsrv_type, "embedded") == 0) {
+       if (strcasecmp_m(rpcsrv_type, "embedded") == 0) {
                epmapper_cb.init         = epmapper_init_cb;
                epmapper_cb.shutdown     = epmapper_shutdown_cb;
                epmapper_cb.private_data = ep_ctx;
@@ -1064,7 +1064,7 @@ bool dcesrv_ep_setup(struct tevent_context *ev_ctx,
                if (!NT_STATUS_IS_OK(rpc_epmapper_init(&epmapper_cb))) {
                        return false;
                }
-       } else if (StrCaseCmp(rpcsrv_type, "daemon") == 0) {
+       } else if (strcasecmp_m(rpcsrv_type, "daemon") == 0) {
                if (!NT_STATUS_IS_OK(rpc_epmapper_init(NULL))) {
                        return false;
                }
@@ -1110,15 +1110,15 @@ bool dcesrv_ep_setup(struct tevent_context *ev_ctx,
                                           "rpc_server",
                                           "spoolss",
                                           "embedded");
-       if (StrCaseCmp(rpcsrv_type, "embedded") == 0) {
+       if (strcasecmp_m(rpcsrv_type, "embedded") == 0) {
                spoolss_cb.init         = spoolss_init_cb;
                spoolss_cb.shutdown     = spoolss_shutdown_cb;
                spoolss_cb.private_data = ep_ctx;
                if (!NT_STATUS_IS_OK(rpc_spoolss_init(&spoolss_cb))) {
                        return false;
                }
-       } else if (StrCaseCmp(rpcsrv_type, "daemon") == 0 ||
-                  StrCaseCmp(rpcsrv_type, "external") == 0) {
+       } else if (strcasecmp_m(rpcsrv_type, "daemon") == 0 ||
+                  strcasecmp_m(rpcsrv_type, "external") == 0) {
                if (!NT_STATUS_IS_OK(rpc_spoolss_init(NULL))) {
                        return false;
                }
index 9328322f2001a24d01bdc12c669e7bcf1793ed72..36ee3038e5741530a7670724edb54e53017be65d 100644 (file)
@@ -895,7 +895,7 @@ NTSTATUS rpc_pipe_open_interface(TALLOC_CTX *mem_ctx,
                                           "rpc_server", pipe_name,
                                           "embedded");
 
-       if (StrCaseCmp(server_type, "embedded") == 0) {
+       if (strcasecmp_m(server_type, "embedded") == 0) {
                status = rpc_pipe_open_internal(tmp_ctx,
                                                syntax, session_info,
                                                client_id, msg_ctx,
@@ -903,8 +903,8 @@ NTSTATUS rpc_pipe_open_interface(TALLOC_CTX *mem_ctx,
                if (!NT_STATUS_IS_OK(status)) {
                        goto done;
                }
-       } else if (StrCaseCmp(server_type, "daemon") == 0 ||
-                  StrCaseCmp(server_type, "external") == 0) {
+       } else if (strcasecmp_m(server_type, "daemon") == 0 ||
+                  strcasecmp_m(server_type, "external") == 0) {
                /* It would be nice to just use rpc_pipe_open_ncalrpc() but
                 * for now we need to use the special proxy setup to connect
                 * to spoolssd. */
index e03f028c858b35f2d32ab920a5755c88c3ad095f..fce4fd8648c590dce892bccd61ba70fb9de44e37 100644 (file)
@@ -2339,32 +2339,32 @@ static WERROR getprinterdata_printer_server(TALLOC_CTX *mem_ctx,
 {
        DEBUG(8,("getprinterdata_printer_server:%s\n", value));
 
-       if (!StrCaseCmp(value, "W3SvcInstalled")) {
+       if (!strcasecmp_m(value, "W3SvcInstalled")) {
                *type = REG_DWORD;
                data->value = 0x00;
                return WERR_OK;
        }
 
-       if (!StrCaseCmp(value, "BeepEnabled")) {
+       if (!strcasecmp_m(value, "BeepEnabled")) {
                *type = REG_DWORD;
                data->value = 0x00;
                return WERR_OK;
        }
 
-       if (!StrCaseCmp(value, "EventLog")) {
+       if (!strcasecmp_m(value, "EventLog")) {
                *type = REG_DWORD;
                /* formally was 0x1b */
                data->value = 0x00;
                return WERR_OK;
        }
 
-       if (!StrCaseCmp(value, "NetPopup")) {
+       if (!strcasecmp_m(value, "NetPopup")) {
                *type = REG_DWORD;
                data->value = 0x00;
                return WERR_OK;
        }
 
-       if (!StrCaseCmp(value, "MajorVersion")) {
+       if (!strcasecmp_m(value, "MajorVersion")) {
                *type = REG_DWORD;
 
                /* Windows NT 4.0 seems to not allow uploading of drivers
@@ -2381,7 +2381,7 @@ static WERROR getprinterdata_printer_server(TALLOC_CTX *mem_ctx,
                return WERR_OK;
        }
 
-       if (!StrCaseCmp(value, "MinorVersion")) {
+       if (!strcasecmp_m(value, "MinorVersion")) {
                *type = REG_DWORD;
                data->value = 0x00;
                return WERR_OK;
@@ -2394,7 +2394,7 @@ static WERROR getprinterdata_printer_server(TALLOC_CTX *mem_ctx,
         *  uint32_t build       = [2195|2600]
         *  extra unicode string = e.g. "Service Pack 3"
         */
-       if (!StrCaseCmp(value, "OSVersion")) {
+       if (!strcasecmp_m(value, "OSVersion")) {
                DATA_BLOB blob;
                enum ndr_err_code ndr_err;
                struct spoolss_OSVersion os;
@@ -2417,7 +2417,7 @@ static WERROR getprinterdata_printer_server(TALLOC_CTX *mem_ctx,
        }
 
 
-       if (!StrCaseCmp(value, "DefaultSpoolDirectory")) {
+       if (!strcasecmp_m(value, "DefaultSpoolDirectory")) {
                *type = REG_SZ;
 
                data->string = talloc_strdup(mem_ctx, "C:\\PRINTERS");
@@ -2426,7 +2426,7 @@ static WERROR getprinterdata_printer_server(TALLOC_CTX *mem_ctx,
                return WERR_OK;
        }
 
-       if (!StrCaseCmp(value, "Architecture")) {
+       if (!strcasecmp_m(value, "Architecture")) {
                *type = REG_SZ;
                data->string = talloc_strdup(mem_ctx,
                        lp_parm_const_string(GLOBAL_SECTION_SNUM, "spoolss", "architecture", SPOOLSS_ARCHITECTURE_NT_X86));
@@ -2435,7 +2435,7 @@ static WERROR getprinterdata_printer_server(TALLOC_CTX *mem_ctx,
                return WERR_OK;
        }
 
-       if (!StrCaseCmp(value, "DsPresent")) {
+       if (!strcasecmp_m(value, "DsPresent")) {
                *type = REG_DWORD;
 
                /* only show the publish check box if we are a
@@ -2449,7 +2449,7 @@ static WERROR getprinterdata_printer_server(TALLOC_CTX *mem_ctx,
                return WERR_OK;
        }
 
-       if (!StrCaseCmp(value, "DNSMachineName")) {
+       if (!strcasecmp_m(value, "DNSMachineName")) {
                const char *hostname = get_mydnsfullname();
 
                if (!hostname) {
index 5702a0e8d717c60724153028c5cfeb75fc232b1c..1c7363299ac0ab5e70796fb3fb62714753d0f837 100644 (file)
@@ -433,7 +433,7 @@ NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name,
        rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
                                           "rpc_server", name,
                                           "embedded");
-       if (StrCaseCmp(rpcsrv_type, "embedded") != 0) {
+       if (strcasecmp_m(rpcsrv_type, "embedded") != 0) {
                external = true;
        }
 
index fdad158efe88b2a6f26f8f92d9b06b38d42b087b..f135b1e86c5947c9c0ef7056439d731757b97b5e 100644 (file)
@@ -284,14 +284,14 @@ static NTSTATUS get_domain_handle(struct rpc_pipe_client *cli,
        struct dcerpc_binding_handle *b = cli->binding_handle;
        NTSTATUS status = NT_STATUS_INVALID_PARAMETER, result;
 
-       if (StrCaseCmp(sam, "domain") == 0) {
+       if (strcasecmp_m(sam, "domain") == 0) {
                status = dcerpc_samr_OpenDomain(b, mem_ctx,
                                              connect_pol,
                                              access_mask,
                                              _domain_sid,
                                              domain_pol,
                                              &result);
-       } else if (StrCaseCmp(sam, "builtin") == 0) {
+       } else if (strcasecmp_m(sam, "builtin") == 0) {
                status = dcerpc_samr_OpenDomain(b, mem_ctx,
                                              connect_pol,
                                              access_mask,
index 42095acc54ba517fe15475b24a8b20b567fef8be..da9826ae0e441b837dccf6b9f6fbbd36c873dd98 100644 (file)
@@ -83,7 +83,7 @@ static const char *cmd_spoolss_get_short_archi(const char *long_archi)
         do {
                 i++;
         } while ( (archi_table[i].long_archi!=NULL ) &&
-                  StrCaseCmp(long_archi, archi_table[i].long_archi) );
+                  strcasecmp_m(long_archi, archi_table[i].long_archi) );
 
         if (archi_table[i].long_archi==NULL) {
                 DEBUGADD(10,("Unknown architecture [%s] !\n", long_archi));
@@ -1616,7 +1616,7 @@ static char *get_driver_3_param(TALLOC_CTX *mem_ctx, char *str,
           parameter because two consecutive delimiters
           will not return an empty string.  See man strtok(3)
           for details */
-       if (ptr && (StrCaseCmp(ptr, "NULL") == 0)) {
+       if (ptr && (strcasecmp_m(ptr, "NULL") == 0)) {
                ptr = NULL;
        }
 
index c2f3e4c917ce93aa0c586e380850e39b06080256..466212b23a61be1d278031dc43a1e94ab7ca3601 100644 (file)
@@ -240,7 +240,7 @@ static NTSTATUS cmd_listcommands(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct
        {
                tmp_set = tmp->cmd_set;
 
-               if (!StrCaseCmp(argv[1], tmp_set->name))
+               if (!strcasecmp_m(argv[1], tmp_set->name))
                {
                        printf("Available commands on the %s pipe:\n\n", tmp_set->name);
 
index 56cfb66c581526bc4499331805b0487db2eb95b4..b012e09f5e3ac2cee9d24f0630e4aa99712e63ef 100644 (file)
@@ -1427,7 +1427,7 @@ static int fill_srv_info(struct srv_info_struct *service,
 
 static int srv_comp(struct srv_info_struct *s1,struct srv_info_struct *s2)
 {
-       return StrCaseCmp(s1->name,s2->name);
+       return strcasecmp_m(s1->name,s2->name);
 }
 
 /****************************************************************************
@@ -1596,7 +1596,7 @@ static int srv_name_match(const char *n1, const char *n2)
         *  the server will return a list of servers that exist on
         *  the network greater than or equal to the FirstNameToReturn.
         */
-       int ret = StrCaseCmp(n1, n2);
+       int ret = strcasecmp_m(n1, n2);
 
        if (ret <= 0) {
                return 0;
@@ -1708,7 +1708,7 @@ static bool api_RNetServerEnum3(struct smbd_server_connection *sconn,
                         */
                        for (;first > 0;) {
                                int ret;
-                               ret = StrCaseCmp(first_name,
+                               ret = strcasecmp_m(first_name,
                                                 servers[first-1].name);
                                if (ret > 0) {
                                        break;
index 29acf8d2219790e203fb4554bfbd45f68b308958..4125aebeb490f9407096cfda1262ea939aea339d 100644 (file)
@@ -1202,7 +1202,7 @@ extern void build_options(bool screen);
                rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
                                                   "rpc_server", "epmapper",
                                                   "none");
-               if (StrCaseCmp(rpcsrv_type, "daemon") == 0) {
+               if (strcasecmp_m(rpcsrv_type, "daemon") == 0) {
                        start_epmd(smbd_event_context(),
                                   smbd_server_conn->msg_ctx);
                }
@@ -1235,7 +1235,7 @@ extern void build_options(bool screen);
                rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
                                                   "rpc_server", "spoolss",
                                                   "embedded");
-               if (StrCaseCmp(rpcsrv_type, "daemon") == 0) {
+               if (strcasecmp_m(rpcsrv_type, "daemon") == 0) {
                        start_spoolssd(smbd_event_context(),
                                       smbd_messaging_context());
                }
index 75d0a41e6bc7da17197244a6c1991fc02d673119..6eae9a5764268be638093986cc3c2852d7d7af5d 100644 (file)
@@ -1219,7 +1219,7 @@ static bool exact_match(bool has_wild,
        if (case_sensitive) {
                return strcmp(str,mask)==0;
        } else {
-               return StrCaseCmp(str,mask) == 0;
+               return strcasecmp_m(str,mask) == 0;
        }
 }
 
index 318423b8be00919a83870f313582b96620f7760f..5be26cdc79f61d2a5683b25508be67bb75955c34 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2003 by Martin Pool
  *
- * Test harness for StrCaseCmp
+ * Test harness for strcasecmp_m
  */
 
 #include "includes.h"
@@ -16,7 +16,7 @@ int main(int argc, char *argv[])
 
        if (argc < 3) {
                fprintf(stderr, "usage: %s STRING1 STRING2 [ITERS]\n"
-                       "Compares two strings, prints the results of StrCaseCmp\n",
+                       "Compares two strings, prints the results of strcasecmp_m\n",
                        argv[0]);
                return 2;
        }
@@ -24,7 +24,7 @@ int main(int argc, char *argv[])
                iters = atoi(argv[3]);
 
        for (i = 0; i < iters; i++)
-               ret = StrCaseCmp(argv[1], argv[2]);
+               ret = strcasecmp_m(argv[1], argv[2]);
 
        printf("%d\n", ret);
        
index 684e0790be5d604218ce48196281ac2d279c14dd..c3497f777b7bc266a2b49cef3e6a5809adfebc6d 100644 (file)
@@ -7980,7 +7980,7 @@ static NTSTATUS split_ntfs_stream_name(TALLOC_CTX *mem_ctx, const char *fname,
                stype = "$DATA";
        }
        else {
-               if (StrCaseCmp(stype, ":$DATA") != 0) {
+               if (strcasecmp_m(stype, ":$DATA") != 0) {
                        /*
                         * If there is an explicit stream type, so far we only
                         * allow $DATA. Is there anything else allowed? -- vl
index 971a0c040a86afc3708a5414b4c696bf58748ad8..6ab00eeb69e378d482d9526364e2fea092949421 100644 (file)
@@ -475,16 +475,16 @@ int main( int argc, char *argv[] )
 
        /*  note that the separate command types should call usage if they need to... */
        while ( 1 ) {
-               if ( !StrCaseCmp( opname, "addsource" ) ) {
+               if ( !strcasecmp_m( opname, "addsource" ) ) {
                        rc = DoAddSourceCommand( argc, argv, opt_debug,
                                                 exename );
                        break;
                }
-               if ( !StrCaseCmp( opname, "write" ) ) {
+               if ( !strcasecmp_m( opname, "write" ) ) {
                        rc = DoWriteCommand( argc, argv, opt_debug, exename );
                        break;
                }
-               if ( !StrCaseCmp( opname, "dump" ) ) {
+               if ( !strcasecmp_m( opname, "dump" ) ) {
                        rc = DoDumpCommand( argc, argv, opt_debug, exename );
                        break;
                }
index 560b58efef822585d3dcb8507f6127bb6d345284..e279c9d2bbf594a5466cba9dd98e9ff076529827 100644 (file)
@@ -441,10 +441,10 @@ static bool usergrp_display(ADS_STRUCT *ads, char *field, void **values, void *d
        }
        if (!values) /* must be new field, indicate string field */
                return true;
-       if (StrCaseCmp(field, "sAMAccountName") == 0) {
+       if (strcasecmp_m(field, "sAMAccountName") == 0) {
                disp_fields[0] = SMB_STRDUP((char *) values[0]);
        }
-       if (StrCaseCmp(field, "description") == 0)
+       if (strcasecmp_m(field, "description") == 0)
                disp_fields[1] = SMB_STRDUP((char *) values[0]);
        return true;
 }
index 2c6ccda110844a339c08c37b6a40f94d2ba7174d..6c61dd7206105896bb4a7d2a11d202110d74a1a2 100644 (file)
@@ -1183,7 +1183,7 @@ static int net_conf_run_function(struct net_context *c, int argc,
 
        if (argc != 0) {
                for (i=0; table[i].funcname; i++) {
-                       if (StrCaseCmp(argv[0], table[i].funcname) == 0)
+                       if (strcasecmp_m(argv[0], table[i].funcname) == 0)
                                return net_conf_wrap_function(c, table[i].fn,
                                                              argc-1,
                                                              argv+1);
index 27f2d24096d354a8a4f5af73ab47db109441494b..71a7e05fe774ccf3b2173b2d63b3080ccc1d25a9 100644 (file)
@@ -44,7 +44,7 @@ int net_file(struct net_context *c, int argc, const char **argv)
        if (argc < 1)
                return net_file_usage(c, argc, argv);
 
-       if (StrCaseCmp(argv[0], "HELP") == 0) {
+       if (strcasecmp_m(argv[0], "HELP") == 0) {
                net_file_usage(c, argc, argv);
                return 0;
        }
index 7114f1feeaaf78b53b2ecc10f5a629120a452bec..505856a00807e4d5f8e8373a36335140f357cadb 100644 (file)
@@ -55,7 +55,7 @@ int net_group(struct net_context *c, int argc, const char **argv)
        if (argc < 1)
                return net_group_usage(c, argc, argv);
 
-       if (StrCaseCmp(argv[0], "HELP") == 0) {
+       if (strcasecmp_m(argv[0], "HELP") == 0) {
                net_group_usage(c, argc, argv);
                return 0;
        }
index 9145093f52d32c5bd283f9a22f47d6b3358ef8c0..ca4c60716630762185970b381a531a9681ea8d21 100644 (file)
@@ -100,7 +100,7 @@ static int net_groupmap_list(struct net_context *c, int argc, const char **argv)
 
        /* get the options */
        for ( i=0; i<argc; i++ ) {
-               if ( !StrCaseCmp(argv[i], "verbose")) {
+               if ( !strcasecmp_m(argv[i], "verbose")) {
                        long_list = true;
                }
                else if ( !StrnCaseCmp(argv[i], "ntgroup", strlen("ntgroup")) ) {
index 4e326ba90209a288fbfd097b454db4b0389e5a9d..4aba1c570378060ce88c9a33900710888a38e119 100644 (file)
@@ -60,7 +60,7 @@ int net_help(struct net_context *c, int argc, const char **argv)
                return net_usage(c, argc, argv);
        }
 
-       if (StrCaseCmp(argv[0], "help") == 0) {
+       if (strcasecmp_m(argv[0], "help") == 0) {
                return net_help_usage(c, argc, argv);
        }
 
index 9e9ef2af065ce502949d7357632a70af9e9863f2..1493dff74d7bd4cb800a5ed2467783ae4f546199 100644 (file)
@@ -34,7 +34,7 @@ int net_join_usage(struct net_context *c, int argc, const char **argv)
 
 int net_join(struct net_context *c, int argc, const char **argv)
 {
-       if ((argc > 0) && (StrCaseCmp(argv[0], "HELP") == 0)) {
+       if ((argc > 0) && (strcasecmp_m(argv[0], "HELP") == 0)) {
                net_join_usage(c, argc, argv);
                return 0;
        }
index 7179d01fe3cd188bf48a530dd9372e76938bf9f1..4191825490de383c6ebcd2e91ddb833be085521d 100644 (file)
@@ -457,7 +457,7 @@ int net_lookup(struct net_context *c, int argc, const char **argv)
                return net_lookup_usage(c, argc, argv);
        }
        for (i=0; table[i].funcname; i++) {
-               if (StrCaseCmp(argv[0], table[i].funcname) == 0)
+               if (strcasecmp_m(argv[0], table[i].funcname) == 0)
                        return table[i].fn(c, argc-1, argv+1);
        }
 
index 05da68dbd18de353c1c3de183809d6a494831143..2c35ae974b3fcca7b4f11995ae73bd6922cd9f22 100644 (file)
@@ -6532,7 +6532,7 @@ static int rpc_trustdom_vampire(struct net_context *c, int argc,
         * or to remote one given in command line
         */
 
-       if (StrCaseCmp(c->opt_workgroup, lp_workgroup())) {
+       if (strcasecmp_m(c->opt_workgroup, lp_workgroup())) {
                domain_name = c->opt_workgroup;
                c->opt_target_workgroup = c->opt_workgroup;
        } else {
@@ -6712,7 +6712,7 @@ static int rpc_trustdom_list(struct net_context *c, int argc, const char **argv)
         * or to remote one given in command line
         */
 
-       if (StrCaseCmp(c->opt_workgroup, lp_workgroup())) {
+       if (strcasecmp_m(c->opt_workgroup, lp_workgroup())) {
                domain_name = c->opt_workgroup;
                c->opt_target_workgroup = c->opt_workgroup;
        } else {
index a2847749b708296ca0c0b94d37b2ae6a31dc7d6e..1b99afa54e8c5f9f63575fd212414c6f9433b95b 100644 (file)
@@ -190,7 +190,7 @@ static NTSTATUS check_privilege_for_user(struct rpc_pipe_client *pipe_hnd,
        }
 
        for (i = 0; i < rights.count; i++) {
-               if (StrCaseCmp(rights.names[i].string, right) == 0) {
+               if (strcasecmp_m(rights.names[i].string, right) == 0) {
                        return NT_STATUS_OK;
                }
        }
index 156b27b572a2506401b9d55758c176d2c584c212..6eca9d64ceb87a4534ff4799359cefcdb7c06731 100644 (file)
@@ -62,7 +62,7 @@ int net_share_usage(struct net_context *c, int argc, const char **argv)
 
 int net_share(struct net_context *c, int argc, const char **argv)
 {
-       if (argc > 0 && StrCaseCmp(argv[0], "HELP") == 0) {
+       if (argc > 0 && strcasecmp_m(argv[0], "HELP") == 0) {
                        net_share_usage(c, argc, argv);
                        return 0;
        }
index 2cf00170de4868697614f74c3aca1f36545c57ac..9fb6f80f929f6e03717251dd87083795786c61be 100644 (file)
@@ -50,7 +50,7 @@ int net_user(struct net_context *c, int argc, const char **argv)
        if (argc < 1)
                return net_user_usage(c, argc, argv);
 
-       if (StrCaseCmp(argv[0], "HELP") == 0) {
+       if (strcasecmp_m(argv[0], "HELP") == 0) {
                net_user_usage(c, argc, argv);
                return 0;
        }
index cc5171f0141748263b858370835e1b970d297c68..09c0b8fc764284034f14d4b684664f2d14c4b894 100644 (file)
@@ -586,7 +586,7 @@ int net_run_function(struct net_context *c, int argc, const char **argv,
 
        if (argc != 0) {
                for (i=0; table[i].funcname != NULL; i++) {
-                       if (StrCaseCmp(argv[0], table[i].funcname) == 0)
+                       if (strcasecmp_m(argv[0], table[i].funcname) == 0)
                                return table[i].fn(c, argc-1, argv+1);
                }
        }