StrCaseCmp was sys_strcasecmp, while it is in fact strcasecmp_m!
24 files changed:
use memory ccaches, and a FILE one probably means that
we're using creds obtained outside of our exectuable
*/
use memory ccaches, and a FILE one probably means that
we're using creds obtained outside of our exectuable
*/
- if (StrCaseCmp(krb5_cc_get_type(context, ccache), "FILE") == 0) {
+ if (strcasecmp_m(krb5_cc_get_type(context, ccache), "FILE") == 0) {
DEBUG(5, ("ads_cleanup_expired_creds: We do not remove creds from a FILE ccache\n"));
return False;
}
DEBUG(5, ("ads_cleanup_expired_creds: We do not remove creds from a FILE ccache\n"));
return False;
}
/* Allow host/dns.name/realm@REALM, just convert into host/dns.name@REALM */
if (princ.name.name_string.len == 3
/* Allow host/dns.name/realm@REALM, just convert into host/dns.name@REALM */
if (princ.name.name_string.len == 3
- && StrCaseCmp(princ.name.name_string.val[2], princ.realm) == 0) {
+ && strcasecmp_m(princ.name.name_string.val[2], princ.realm) == 0) {
princ.name.name_string.len = 2;
}
princ.name.name_string.len = 2;
}
extern void mprSetCtx(void *ctx);
extern void *mprMemCtx(void);
extern void mprSetCtx(void *ctx);
extern void *mprMemCtx(void);
-#define mprStrCmpAnyCase(s1, s2) StrCaseCmp(s1, s2)
+#define mprStrCmpAnyCase(s1, s2) strcasecmp_m(s1, s2)
if (strpbrk(pattern, "<>*?\"") == NULL) {
/* this is not just an optmisation - it is essential
for LANMAN1 correctness */
if (strpbrk(pattern, "<>*?\"") == NULL) {
/* this is not just an optmisation - it is essential
for LANMAN1 correctness */
- return StrCaseCmp(pattern, string);
+ return strcasecmp_m(pattern, string);
}
if (protocol <= PROTOCOL_LANMAN2) {
}
if (protocol <= PROTOCOL_LANMAN2) {
int i;
for (i = 0; i < db->secrets.domain_count; i++) {
int i;
for (i = 0; i < db->secrets.domain_count; i++) {
- if (!StrCaseCmp(db->secrets.domains[i].name, name))
+ if (!strcasecmp_m(db->secrets.domains[i].name, name))
return &db->secrets.domains[i];
}
return &db->secrets.domains[i];
}
{
int i;
for (i = 0; i < db->share_count; i++) {
{
int i;
for (i = 0; i < db->share_count; i++) {
- if (!StrCaseCmp(db->shares[i].name, name))
+ if (!strcasecmp_m(db->shares[i].name, name))
return NULL;
for (i = 0; i < share->parameter_count; i++) {
return NULL;
for (i = 0; i < share->parameter_count; i++) {
- if (!StrCaseCmp(share->parameters[i].name, param))
+ if (!strcasecmp_m(share->parameters[i].name, param))
return share->parameters[i].value;
}
return share->parameters[i].value;
}
for (i = 0; i < db->domain_count; i++)
{
for (i = 0; i < db->domain_count; i++)
{
- if (!StrCaseCmp(db->domains[i].name, key))
+ if (!strcasecmp_m(db->domains[i].name, key))
return &db->domains[i];
}
return &db->domains[i];
}
/**
Case insensitive string compararison
**/
/**
Case insensitive string compararison
**/
-int StrCaseCmp(const char *s1, const char *s2)
+int strcasecmp_m(const char *s1, const char *s2)
{
codepoint_t c1=0, c2=0;
size_t size1, size2;
{
codepoint_t c1=0, c2=0;
size_t size1, size2;
if (!s1 || !s2)
return(False);
if (!s1 || !s2)
return(False);
- return StrCaseCmp(s1,s2) == 0;
+ return strcasecmp_m(s1,s2) == 0;
if (strcmp(tok,s) == 0)
return(True);
} else {
if (strcmp(tok,s) == 0)
return(True);
} else {
- if (StrCaseCmp(tok,s) == 0)
+ if (strcasecmp_m(tok,s) == 0)
}
for (i=0; handlers[i].name; i++) {
}
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(field, (struct berval **) values);
if (!values) /* first time, indicate string or not */
return handlers[i].string;
handlers[i].handler(field, (struct berval **) values);
int i;
for (i=0; map[i].valname; i++) {
int i;
for (i=0; map[i].valname; i++) {
- if (StrCaseCmp(map[i].valname, value->valuename) == 0) {
+ if (strcasecmp_m(map[i].valname, value->valuename) == 0) {
if (!map[i].fn(ctx, mods, value)) {
DEBUG(5, ("Add of value %s to modlist failed\n", value->valuename));
} else {
if (!map[i].fn(ctx, mods, value)) {
DEBUG(5, ("Add of value %s to modlist failed\n", value->valuename));
} else {
for (t=samdump_state->trusted_domains; t; t=t->next) {
char *secret_name = talloc_asprintf(mem_ctx, "G$$%s", t->name);
for (s=samdump_state->secrets; s; s=s->next) {
for (t=samdump_state->trusted_domains; t; t=t->next) {
char *secret_name = talloc_asprintf(mem_ctx, "G$$%s", t->name);
for (s=samdump_state->secrets; s; s=s->next) {
- if (StrCaseCmp(s->name, secret_name) == 0) {
+ if (strcasecmp_m(s->name, secret_name) == 0) {
char *secret_string;
if (convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX,
s->secret.data, s->secret.length,
char *secret_string;
if (convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX,
s->secret.data, s->secret.length,
for (i=dir->name_cache_index;i>=0;i--) {
struct name_cache_entry *e = &dir->name_cache[i];
for (i=dir->name_cache_index;i>=0;i--) {
struct name_cache_entry *e = &dir->name_cache[i];
- if (e->name && StrCaseCmp(name, e->name) == 0) {
+ if (e->name && strcasecmp_m(name, e->name) == 0) {
*ofs = e->offset;
return NT_STATUS_OK;
}
}
for (i=NAME_CACHE_SIZE-1;i>dir->name_cache_index;i--) {
struct name_cache_entry *e = &dir->name_cache[i];
*ofs = e->offset;
return NT_STATUS_OK;
}
}
for (i=NAME_CACHE_SIZE-1;i>dir->name_cache_index;i--) {
struct name_cache_entry *e = &dir->name_cache[i];
- if (e->name && StrCaseCmp(name, e->name) == 0) {
+ if (e->name && strcasecmp_m(name, e->name) == 0) {
*ofs = e->offset;
return NT_STATUS_OK;
}
*ofs = e->offset;
return NT_STATUS_OK;
}
rewinddir(dir->dir);
while ((de = readdir(dir->dir))) {
rewinddir(dir->dir);
while ((de = readdir(dir->dir))) {
- if (StrCaseCmp(name, de->d_name) == 0) {
+ if (strcasecmp_m(name, de->d_name) == 0) {
dir->offset = telldir(dir->dir) + DIR_OFFSET_BASE;
*ofs = dir->offset;
return NT_STATUS_OK;
dir->offset = telldir(dir->dir) + DIR_OFFSET_BASE;
*ofs = dir->offset;
return NT_STATUS_OK;
(NTCREATEX_OPTIONS_PRIVATE_DENY_DOS |
NTCREATEX_OPTIONS_PRIVATE_DENY_FCB)) &&
(f2->access_mask & SEC_FILE_WRITE_DATA) &&
(NTCREATEX_OPTIONS_PRIVATE_DENY_DOS |
NTCREATEX_OPTIONS_PRIVATE_DENY_FCB)) &&
(f2->access_mask & SEC_FILE_WRITE_DATA) &&
- StrCaseCmp(f2->handle->name->original_name,
+ strcasecmp_m(f2->handle->name->original_name,
io->generic.in.fname)==0) {
break;
}
io->generic.in.fname)==0) {
break;
}
eas->eas[i].name.s = names[i].name.s;
eas->eas[i].value = data_blob(NULL, 0);
for (j=0;j<ealist->num_eas;j++) {
eas->eas[i].name.s = names[i].name.s;
eas->eas[i].value = data_blob(NULL, 0);
for (j=0;j<ealist->num_eas;j++) {
- if (StrCaseCmp(eas->eas[i].name.s,
+ if (strcasecmp_m(eas->eas[i].name.s,
ealist->eas[j].name) == 0) {
eas->eas[i].value = ealist->eas[j].value;
break;
ealist->eas[j].name) == 0) {
eas->eas[i].value = ealist->eas[j].value;
break;
- ret = StrCaseCmp(comp, name);
+ ret = strcasecmp_m(comp, name);
if (ret != 0) {
char *shortname = pvfs_short_name_component(pvfs, name);
if (shortname) {
if (ret != 0) {
char *shortname = pvfs_short_name_component(pvfs, name);
if (shortname) {
- ret = StrCaseCmp(comp, shortname);
+ ret = strcasecmp_m(comp, shortname);
talloc_free(shortname);
}
}
talloc_free(shortname);
}
}
strlen(name->stream_name));
return NT_STATUS_OK;
}
strlen(name->stream_name));
return NT_STATUS_OK;
}
- if (StrCaseCmp(p, ":$DATA") != 0) {
+ if (strcasecmp_m(p, ":$DATA") != 0) {
return NT_STATUS_OBJECT_NAME_INVALID;
}
*p = 0;
return NT_STATUS_OBJECT_NAME_INVALID;
}
*p = 0;
struct ea_struct *ea = &eas[j];
/* see if its already there */
for (i=0;i<ealist->num_eas;i++) {
struct ea_struct *ea = &eas[j];
/* see if its already there */
for (i=0;i<ealist->num_eas;i++) {
- if (StrCaseCmp(ealist->eas[i].name, ea->name.s) == 0) {
+ if (strcasecmp_m(ealist->eas[i].name, ea->name.s) == 0) {
ealist->eas[i].value = ea->value;
break;
}
ealist->eas[i].value = ea->value;
break;
}
for (i=0;i<streams->num_streams;i++) {
struct xattr_DosStream *s = &streams->streams[i];
for (i=0;i<streams->num_streams;i++) {
struct xattr_DosStream *s = &streams->streams[i];
- if (StrCaseCmp(s->name, name->stream_name) == 0) {
+ if (strcasecmp_m(s->name, name->stream_name) == 0) {
name->dos.alloc_size = pvfs_round_alloc_size(pvfs, s->alloc_size);
name->st.st_size = s->size;
name->stream_exists = True;
name->dos.alloc_size = pvfs_round_alloc_size(pvfs, s->alloc_size);
name->st.st_size = s->size;
name->stream_exists = True;
for (i=0;i<streams->num_streams;i++) {
struct xattr_DosStream *s = &streams->streams[i];
for (i=0;i<streams->num_streams;i++) {
struct xattr_DosStream *s = &streams->streams[i];
- if (StrCaseCmp(s->name, name->stream_name) == 0) {
+ if (strcasecmp_m(s->name, name->stream_name) == 0) {
s->size = size;
s->alloc_size = pvfs_round_alloc_size(pvfs, size);
break;
s->size = size;
s->alloc_size = pvfs_round_alloc_size(pvfs, size);
break;
for (i=0;i<streams->num_streams;i++) {
struct xattr_DosStream *s = &streams->streams[i];
for (i=0;i<streams->num_streams;i++) {
struct xattr_DosStream *s = &streams->streams[i];
- if (StrCaseCmp(s->name, name->stream_name) == 0) {
+ if (strcasecmp_m(s->name, name->stream_name) == 0) {
memmove(s, s+1, (streams->num_streams - (i+1)) * sizeof(*s));
streams->num_streams--;
break;
memmove(s, s+1, (streams->num_streams - (i+1)) * sizeof(*s));
streams->num_streams--;
break;
if (ldb_flag == LDB_FLAG_MOD_ADD) {
int j;
for (j=0;j<r2.out.rights->count;j++) {
if (ldb_flag == LDB_FLAG_MOD_ADD) {
int j;
for (j=0;j<r2.out.rights->count;j++) {
- if (StrCaseCmp(r2.out.rights->names[j].string,
+ if (strcasecmp_m(r2.out.rights->names[j].string,
rights->names[i].string) == 0) {
break;
}
rights->names[i].string) == 0) {
break;
}
}} while (0)
#define CHECK_STRING(v, correct) do { \
}} while (0)
#define CHECK_STRING(v, correct) do { \
- if (StrCaseCmp(v, correct) != 0) { \
+ if (strcasecmp_m(v, correct) != 0) { \
printf("(%s) Incorrect value %s='%s' - should be '%s'\n", \
__location__, #v, v, correct); \
ret = False; \
printf("(%s) Incorrect value %s='%s' - should be '%s'\n", \
__location__, #v, v, correct); \
ret = False; \
#define CHECK_STRING(v, correct) do { \
if ((v) != (correct) && \
#define CHECK_STRING(v, correct) do { \
if ((v) != (correct) && \
- ((v)==NULL || (correct)==NULL || StrCaseCmp(v, correct) != 0)) { \
+ ((v)==NULL || (correct)==NULL || strcasecmp_m(v, correct) != 0)) { \
printf("(%s) Incorrect value %s='%s' - should be '%s'\n", \
__location__, #v, v, correct); \
ret = False; \
printf("(%s) Incorrect value %s='%s' - should be '%s'\n", \
__location__, #v, v, correct); \
ret = False; \
}} while (0)
#define CHECK_STRING(v, correct) do { \
}} while (0)
#define CHECK_STRING(v, correct) do { \
- if (StrCaseCmp(v, correct) != 0) { \
+ if (strcasecmp_m(v, correct) != 0) { \
printf("(%s) Incorrect value %s='%s' - should be '%s'\n", \
__location__, #v, v, correct); \
ret = False; \
printf("(%s) Incorrect value %s='%s' - should be '%s'\n", \
__location__, #v, v, correct); \
ret = False; \
const char *name1, *name2;
name1 = result.list[i].both_directory_info.name.s;
name2 = result.list[i+1].both_directory_info.name.s;
const char *name1, *name2;
name1 = result.list[i].both_directory_info.name.s;
name2 = result.list[i+1].both_directory_info.name.s;
- if (StrCaseCmp(name1, name2) > 0) {
+ if (strcasecmp_m(name1, name2) > 0) {
printf("non-alphabetical order at entry %d '%s' '%s'\n",
i, name1, name2);
printf("Server does not produce sorted directory listings (not an error)\n");
printf("non-alphabetical order at entry %d '%s' '%s'\n",
i, name1, name2);
printf("Server does not produce sorted directory listings (not an error)\n");
case SAM_DATABASE_DOMAIN:
break;
case SAM_DATABASE_BUILTIN:
case SAM_DATABASE_DOMAIN:
break;
case SAM_DATABASE_BUILTIN:
- if (StrCaseCmp("BUILTIN", domain->domain_name.string) != 0) {
+ if (strcasecmp_m("BUILTIN", domain->domain_name.string) != 0) {
printf("BUILTIN domain has different name: %s\n", domain->domain_name.string);
}
break;
printf("BUILTIN domain has different name: %s\n", domain->domain_name.string);
}
break;
samsync_state->domain_name[database_id] =
talloc_reference(samsync_state, domain->domain_name.string);
} else {
samsync_state->domain_name[database_id] =
talloc_reference(samsync_state, domain->domain_name.string);
} else {
- if (StrCaseCmp(samsync_state->domain_name[database_id], domain->domain_name.string) != 0) {
+ if (strcasecmp_m(samsync_state->domain_name[database_id], domain->domain_name.string) != 0) {
printf("Domain has name varies!: %s != %s\n", samsync_state->domain_name[database_id],
domain->domain_name.string);
return False;
printf("Domain has name varies!: %s != %s\n", samsync_state->domain_name[database_id],
domain->domain_name.string);
return False;
samsync_state->domain_name[SAM_DATABASE_DOMAIN] =
talloc_reference(samsync_state, policy->primary_domain_name.string);
} else {
samsync_state->domain_name[SAM_DATABASE_DOMAIN] =
talloc_reference(samsync_state, policy->primary_domain_name.string);
} else {
- if (StrCaseCmp(samsync_state->domain_name[SAM_DATABASE_DOMAIN], policy->primary_domain_name.string) != 0) {
+ if (strcasecmp_m(samsync_state->domain_name[SAM_DATABASE_DOMAIN], policy->primary_domain_name.string) != 0) {
printf("PRIMARY domain has name varies between DOMAIN and POLICY!: %s != %s\n", samsync_state->domain_name[SAM_DATABASE_DOMAIN],
policy->primary_domain_name.string);
return False;
printf("PRIMARY domain has name varies between DOMAIN and POLICY!: %s != %s\n", samsync_state->domain_name[SAM_DATABASE_DOMAIN],
policy->primary_domain_name.string);
return False;
for (t=samsync_state->trusted_domains; t; t=t->next) {
char *secret_name = talloc_asprintf(trustdom_ctx, "G$$%s", t->name);
for (s=samsync_state->secrets; s; s=s->next) {
for (t=samsync_state->trusted_domains; t; t=t->next) {
char *secret_name = talloc_asprintf(trustdom_ctx, "G$$%s", t->name);
for (s=samsync_state->secrets; s; s=s->next) {
- if (StrCaseCmp(s->name, secret_name) == 0) {
+ if (strcasecmp_m(s->name, secret_name) == 0) {
NTSTATUS nt_status;
struct samr_Password nt_hash;
mdfour(nt_hash.hash, s->secret.data, s->secret.length);
NTSTATUS nt_status;
struct samr_Password nt_hash;
mdfour(nt_hash.hash, s->secret.data, s->secret.length);
/*
* Copyright (C) 2003 by Martin Pool
*
/*
* Copyright (C) 2003 by Martin Pool
*
- * Test harness for StrCaseCmp
+ * Test harness for strcasecmp_m
- printf("%d\n", StrCaseCmp(argv[1], argv[2]));
+ printf("%d\n", strcasecmp_m(argv[1], argv[2]));
return NT_STATUS_EA_CORRUPT_ERROR;
}
return NT_STATUS_EA_CORRUPT_ERROR;
}
- if (StrCaseCmp(eaname, info.ea_list.out.eas[0].name.s) != 0) {
+ if (strcasecmp_m(eaname, info.ea_list.out.eas[0].name.s) != 0) {
printf("Expected ea '%s' not '%s' in ea_list\n",
eaname, info.ea_list.out.eas[0].name.s);
talloc_free(mem_ctx);
printf("Expected ea '%s' not '%s' in ea_list\n",
eaname, info.ea_list.out.eas[0].name.s);
talloc_free(mem_ctx);
}
for (i=0; functable[i].name; i++) {
}
for (i=0; functable[i].name; i++) {
- if (StrCaseCmp(argv[0], functable[i].name) == 0)
+ if (strcasecmp_m(argv[0], functable[i].name) == 0)
return functable[i].fn(ctx, argc-1, argv+1);
}
return functable[i].fn(ctx, argc-1, argv+1);
}
}
*/
for (i=0; functable[i].name; i++) {
}
*/
for (i=0; functable[i].name; i++) {
- if (StrCaseCmp(argv[0], functable[i].name) == 0)
+ if (strcasecmp_m(argv[0], functable[i].name) == 0)
if (functable[i].usage) {
return functable[i].usage(ctx, argc-1, argv+1);
}
if (functable[i].usage) {
return functable[i].usage(ctx, argc-1, argv+1);
}