summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-05-13 20:21:30 +0200
committerAndrew Bartlett <abartlet@samba.org>2011-05-18 16:12:08 +0200
commitc615ebed6e3d273a682806b952d543e834e5630d (patch)
tree4dbc96ec8a7ac5bcb158d331c07ceb0150bf4fe0 /source3/utils
parent7a11e5de395c928e4a37c58a7a7ac21a314449fe (diff)
downloadsamba-c615ebed6e3d273a682806b952d543e834e5630d.tar.gz
samba-c615ebed6e3d273a682806b952d543e834e5630d.tar.bz2
samba-c615ebed6e3d273a682806b952d543e834e5630d.zip
s3-lib Replace StrCaseCmp() with strcasecmp_m()
strcasecmp_m() never needs to call to talloc, and via next_codepoint() still has an ASCII fast-path bypassing iconv() calls. Andrew Bartlett
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/eventlogadm.c6
-rw-r--r--source3/utils/net_ads.c4
-rw-r--r--source3/utils/net_conf.c2
-rw-r--r--source3/utils/net_file.c2
-rw-r--r--source3/utils/net_group.c2
-rw-r--r--source3/utils/net_groupmap.c2
-rw-r--r--source3/utils/net_help.c2
-rw-r--r--source3/utils/net_join.c2
-rw-r--r--source3/utils/net_lookup.c2
-rw-r--r--source3/utils/net_rpc.c4
-rw-r--r--source3/utils/net_rpc_rights.c2
-rw-r--r--source3/utils/net_share.c2
-rw-r--r--source3/utils/net_user.c2
-rw-r--r--source3/utils/net_util.c2
14 files changed, 18 insertions, 18 deletions
diff --git a/source3/utils/eventlogadm.c b/source3/utils/eventlogadm.c
index 971a0c040a..6ab00eeb69 100644
--- a/source3/utils/eventlogadm.c
+++ b/source3/utils/eventlogadm.c
@@ -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;
}
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 560b58efef..e279c9d2bb 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -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;
}
diff --git a/source3/utils/net_conf.c b/source3/utils/net_conf.c
index 2c6ccda110..6c61dd7206 100644
--- a/source3/utils/net_conf.c
+++ b/source3/utils/net_conf.c
@@ -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);
diff --git a/source3/utils/net_file.c b/source3/utils/net_file.c
index 27f2d24096..71a7e05fe7 100644
--- a/source3/utils/net_file.c
+++ b/source3/utils/net_file.c
@@ -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;
}
diff --git a/source3/utils/net_group.c b/source3/utils/net_group.c
index 7114f1feea..505856a008 100644
--- a/source3/utils/net_group.c
+++ b/source3/utils/net_group.c
@@ -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;
}
diff --git a/source3/utils/net_groupmap.c b/source3/utils/net_groupmap.c
index 9145093f52..ca4c607166 100644
--- a/source3/utils/net_groupmap.c
+++ b/source3/utils/net_groupmap.c
@@ -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")) ) {
diff --git a/source3/utils/net_help.c b/source3/utils/net_help.c
index 4e326ba902..4aba1c5703 100644
--- a/source3/utils/net_help.c
+++ b/source3/utils/net_help.c
@@ -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);
}
diff --git a/source3/utils/net_join.c b/source3/utils/net_join.c
index 9e9ef2af06..1493dff74d 100644
--- a/source3/utils/net_join.c
+++ b/source3/utils/net_join.c
@@ -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;
}
diff --git a/source3/utils/net_lookup.c b/source3/utils/net_lookup.c
index 7179d01fe3..4191825490 100644
--- a/source3/utils/net_lookup.c
+++ b/source3/utils/net_lookup.c
@@ -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);
}
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 05da68dbd1..2c35ae974b 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -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 {
diff --git a/source3/utils/net_rpc_rights.c b/source3/utils/net_rpc_rights.c
index a2847749b7..1b99afa54e 100644
--- a/source3/utils/net_rpc_rights.c
+++ b/source3/utils/net_rpc_rights.c
@@ -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;
}
}
diff --git a/source3/utils/net_share.c b/source3/utils/net_share.c
index 156b27b572..6eca9d64ce 100644
--- a/source3/utils/net_share.c
+++ b/source3/utils/net_share.c
@@ -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;
}
diff --git a/source3/utils/net_user.c b/source3/utils/net_user.c
index 2cf00170de..9fb6f80f92 100644
--- a/source3/utils/net_user.c
+++ b/source3/utils/net_user.c
@@ -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;
}
diff --git a/source3/utils/net_util.c b/source3/utils/net_util.c
index cc5171f014..09c0b8fc76 100644
--- a/source3/utils/net_util.c
+++ b/source3/utils/net_util.c
@@ -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);
}
}