summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2012-01-12 15:10:42 +1100
committerAmitay Isaacs <amitay@samba.org>2012-01-12 05:10:08 +0100
commit44a85e3752ceaacdcc39a6a1d0faa0ff3d3db004 (patch)
treee251c4a3c77c9541a68b49d7463a5832b749e190 /source4
parentddc1f3df5183081aeb7c5b97b7fa4426c772346d (diff)
downloadsamba-44a85e3752ceaacdcc39a6a1d0faa0ff3d3db004.tar.gz
samba-44a85e3752ceaacdcc39a6a1d0faa0ff3d3db004.tar.bz2
samba-44a85e3752ceaacdcc39a6a1d0faa0ff3d3db004.zip
s4-rpc:dnsserver: DNS names are case insensitive
Diffstat (limited to 'source4')
-rw-r--r--source4/rpc_server/dnsserver/dcerpc_dnsserver.c8
-rw-r--r--source4/rpc_server/dnsserver/dnsdata.c18
-rw-r--r--source4/rpc_server/dnsserver/dnsutils.c8
3 files changed, 17 insertions, 17 deletions
diff --git a/source4/rpc_server/dnsserver/dcerpc_dnsserver.c b/source4/rpc_server/dnsserver/dcerpc_dnsserver.c
index fac99e1cb6..5733a51177 100644
--- a/source4/rpc_server/dnsserver/dcerpc_dnsserver.c
+++ b/source4/rpc_server/dnsserver/dcerpc_dnsserver.c
@@ -1433,7 +1433,7 @@ static WERROR dnsserver_complex_operate_server(struct dnsserver_state *dsstate,
*typeid_out = DNSSRV_TYPEID_DP_INFO;
for (p = dsstate->partitions; p; p = p->next) {
- if (strcmp(p->pszDpFqdn, rin->String) == 0) {
+ if (strcasecmp(p->pszDpFqdn, rin->String) == 0) {
dpinfo = talloc_zero(mem_ctx, struct DNS_RPC_DP_INFO);
W_ERROR_HAVE_NO_MEMORY(dpinfo);
@@ -1720,7 +1720,7 @@ static WERROR dnsserver_enumerate_records(struct dnsserver_state *dsstate,
W_ERROR_HAVE_NO_MEMORY_AND_FREE(name, tmp_ctx);
/* search all records under parent tree */
- if (strcmp(name, z->name) == 0) {
+ if (strcasecmp(name, z->name) == 0) {
ret = ldb_search(dsstate->samdb, tmp_ctx, &res, z->zone_dn,
LDB_SCOPE_ONELEVEL, attrs, "(objectClass=dnsNode)");
} else {
@@ -1746,7 +1746,7 @@ static WERROR dnsserver_enumerate_records(struct dnsserver_state *dsstate,
(ldb_qsort_cmp_fn_t)dns_name_compare);
/* Build a tree of name components from dns name */
- if (strcmp(name, z->name) == 0) {
+ if (strcasecmp(name, z->name) == 0) {
tree = dns_build_tree(tmp_ctx, "@", res);
} else {
tree = dns_build_tree(tmp_ctx, name, res);
@@ -1853,7 +1853,7 @@ static WERROR dnsserver_update_record(struct dnsserver_state *dsstate,
W_ERROR_HAVE_NO_MEMORY(tmp_ctx);
/* If node_name is @ or zone name, dns record is @ */
- if (strcmp(node_name, "@") == 0 || strcmp(node_name, z->name) == 0) {
+ if (strcmp(node_name, "@") == 0 || strcasecmp(node_name, z->name) == 0) {
name = talloc_strdup(tmp_ctx, "@");
} else {
name = dns_split_node_name(tmp_ctx, node_name, z->name);
diff --git a/source4/rpc_server/dnsserver/dnsdata.c b/source4/rpc_server/dnsserver/dnsdata.c
index b2ab2d9ff5..50be4bcbf1 100644
--- a/source4/rpc_server/dnsserver/dnsdata.c
+++ b/source4/rpc_server/dnsserver/dnsdata.c
@@ -204,7 +204,7 @@ char *dns_split_node_name(TALLOC_CTX *tmp_ctx, const char *node_name, const char
} else {
match = 0;
for (i=1; i<=zcount; i++) {
- if (strcmp(nlist[ncount-i], zlist[zcount-i]) != 0) {
+ if (strcasecmp(nlist[ncount-i], zlist[zcount-i]) != 0) {
break;
}
match++;
@@ -535,7 +535,7 @@ static struct dns_tree *dns_tree_find(struct dns_tree *tree, int ncount, char **
if (strcmp(tree->name, "@") == 0) {
start = 0;
} else {
- if (strcmp(tree->name, nlist[ncount-1]) != 0) {
+ if (strcasecmp(tree->name, nlist[ncount-1]) != 0) {
return NULL;
}
start = 1;
@@ -549,7 +549,7 @@ static struct dns_tree *dns_tree_find(struct dns_tree *tree, int ncount, char **
}
next = NULL;
for (j=0; j<node->num_children; j++) {
- if (strcmp(nlist[(ncount-1)-i], node->children[j]->name) == 0) {
+ if (strcasecmp(nlist[(ncount-1)-i], node->children[j]->name) == 0) {
next = node->children[j];
*match_count = i;
break;
@@ -601,7 +601,7 @@ struct dns_tree *dns_build_tree(TALLOC_CTX *mem_ctx, const char *name, struct ld
if (strcmp(ptr, "@") == 0) {
base->data = res->msgs[i];
continue;
- } else if (strcmp(ptr, name) == 0) {
+ } else if (strcasecmp(ptr, name) == 0) {
base->data = res->msgs[i];
continue;
}
@@ -659,7 +659,7 @@ static void _dns_add_name(TALLOC_CTX *mem_ctx, const char *name, char ***add_nam
int count = *add_count;
for (i=0; i<count; i++) {
- if (strcmp(ptr[i], name) == 0) {
+ if (strcasecmp(ptr[i], name) == 0) {
return;
}
}
@@ -860,14 +860,14 @@ int dns_name_compare(const struct ldb_message **m1, const struct ldb_message **m
if (name1[0] == '@') {
return -1;
}
- if (search_name && strcmp(name1, search_name) == 0) {
+ if (search_name && strcasecmp(name1, search_name) == 0) {
return -1;
}
if (name2[0] == '@') {
return 1;
}
- if (search_name && strcmp(name2, search_name) == 0) {
+ if (search_name && strcasecmp(name2, search_name) == 0) {
return 1;
}
@@ -877,7 +877,7 @@ int dns_name_compare(const struct ldb_message **m1, const struct ldb_message **m
if (ptr1 == NULL) {
ptr1 = name1;
} else {
- if (search_name && strcmp(ptr1+1, search_name) == 0) {
+ if (search_name && strcasecmp(ptr1+1, search_name) == 0) {
ptr1--;
while (ptr1 != name1) {
ptr1--;
@@ -895,7 +895,7 @@ int dns_name_compare(const struct ldb_message **m1, const struct ldb_message **m
if (ptr2 == NULL) {
ptr2 = name2;
} else {
- if (search_name && strcmp(ptr2+1, search_name) == 0) {
+ if (search_name && strcasecmp(ptr2+1, search_name) == 0) {
ptr2--;
while (ptr2 != name2) {
ptr2--;
diff --git a/source4/rpc_server/dnsserver/dnsutils.c b/source4/rpc_server/dnsserver/dnsutils.c
index 5390384e57..52a8bdde29 100644
--- a/source4/rpc_server/dnsserver/dnsutils.c
+++ b/source4/rpc_server/dnsserver/dnsutils.c
@@ -170,7 +170,7 @@ struct dnsserver_zoneinfo *dnsserver_init_zoneinfo(struct dnsserver_zone *zone,
fReverse = 0;
len1 = strlen(zone->name);
len2 = strlen(revzone);
- if (len1 > len2 && strcmp(&zone->name[len1-len2], revzone) == 0) {
+ if (len1 > len2 && strcasecmp(&zone->name[len1-len2], revzone) == 0) {
fReverse = 1;
}
@@ -229,7 +229,7 @@ struct dnsserver_partition *dnsserver_find_partition(struct dnsserver_partition
struct dnsserver_partition *p = NULL;
for (p = partitions; p; p = p->next) {
- if (strcmp(dp_fqdn, p->pszDpFqdn) == 0) {
+ if (strcasecmp(dp_fqdn, p->pszDpFqdn) == 0) {
break;
}
}
@@ -242,7 +242,7 @@ struct dnsserver_zone *dnsserver_find_zone(struct dnsserver_zone *zones, const c
struct dnsserver_zone *z = NULL;
for (z = zones; z; z = z->next) {
- if (strcmp(zone_name, z->name) == 0) {
+ if (strcasecmp(zone_name, z->name) == 0) {
break;
}
}
@@ -259,7 +259,7 @@ struct ldb_dn *dnsserver_name_to_dn(TALLOC_CTX *mem_ctx, struct dnsserver_zone *
if (dn == NULL) {
return NULL;
}
- if (strcmp(name, z->name) == 0) {
+ if (strcasecmp(name, z->name) == 0) {
ret = ldb_dn_add_child_fmt(dn, "DC=@");
} else {
ret = ldb_dn_add_child_fmt(dn, "DC=%s", name);