summaryrefslogtreecommitdiff
path: root/source3/rpc_server
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/rpc_server
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/rpc_server')
-rw-r--r--source3/rpc_server/lsa/srv_lsa_nt.c8
-rw-r--r--source3/rpc_server/rpc_ep_setup.c66
-rw-r--r--source3/rpc_server/rpc_ncacn_np.c6
-rw-r--r--source3/rpc_server/spoolss/srv_spoolss_nt.c22
-rw-r--r--source3/rpc_server/srv_pipe_hnd.c2
5 files changed, 52 insertions, 52 deletions
diff --git a/source3/rpc_server/lsa/srv_lsa_nt.c b/source3/rpc_server/lsa/srv_lsa_nt.c
index 341bd5d424..da0f697dc9 100644
--- a/source3/rpc_server/lsa/srv_lsa_nt.c
+++ b/source3/rpc_server/lsa/srv_lsa_nt.c
@@ -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;
}
diff --git a/source3/rpc_server/rpc_ep_setup.c b/source3/rpc_server/rpc_ep_setup.c
index d00b35161c..2dc54bd812 100644
--- a/source3/rpc_server/rpc_ep_setup.c
+++ b/source3/rpc_server/rpc_ep_setup.c
@@ -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;
}
diff --git a/source3/rpc_server/rpc_ncacn_np.c b/source3/rpc_server/rpc_ncacn_np.c
index 9328322f20..36ee3038e5 100644
--- a/source3/rpc_server/rpc_ncacn_np.c
+++ b/source3/rpc_server/rpc_ncacn_np.c
@@ -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. */
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c
index e03f028c85..fce4fd8648 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -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) {
diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c
index 5702a0e8d7..1c7363299a 100644
--- a/source3/rpc_server/srv_pipe_hnd.c
+++ b/source3/rpc_server/srv_pipe_hnd.c
@@ -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;
}