*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);
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 {
(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);
tmp_ctx = talloc_new(mem_ctx);
W_ERROR_HAVE_NO_MEMORY(tmp_ctx);
- name = dns_split_node_name(tmp_ctx, node_name, z->name);
+ /* If node_name is @ or zone name, dns record is @ */
+ 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);
+ }
W_ERROR_HAVE_NO_MEMORY_AND_FREE(name, tmp_ctx);
if (add_buf != NULL) {
r->in.dwTypeId,
&r->in.pData);
} else {
+ z = dnsserver_find_zone(dsstate->zones, r->in.pszZone);
+ if (z == NULL && request_filter == 0) {
+ return WERR_DNS_ERROR_ZONE_DOES_NOT_EXIST;
+ }
+
ret = dnsserver_operate_zone(dsstate, mem_ctx, z,
request_filter,
r->in.pszOperation,
r->in.dwTypeId,
&r->in.pData);
} else {
+ z = dnsserver_find_zone(dsstate->zones, r->in.pszZone);
+ if (z == NULL && request_filter == 0) {
+ return WERR_DNS_ERROR_ZONE_DOES_NOT_EXIST;
+ }
+
ret = dnsserver_operate_zone(dsstate, mem_ctx, z,
request_filter,
r->in.pszOperation,