summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/dnsserver/dcerpc_dnsserver.c35
-rw-r--r--source4/rpc_server/dnsserver/dnsdb.c2
2 files changed, 36 insertions, 1 deletions
diff --git a/source4/rpc_server/dnsserver/dcerpc_dnsserver.c b/source4/rpc_server/dnsserver/dcerpc_dnsserver.c
index 715b8a6c37..2d9fadd91e 100644
--- a/source4/rpc_server/dnsserver/dcerpc_dnsserver.c
+++ b/source4/rpc_server/dnsserver/dcerpc_dnsserver.c
@@ -1294,7 +1294,40 @@ static WERROR dnsserver_complex_operate_server(struct dnsserver_state *dsstate,
} else if (strcasecmp(operation, "EnumZones2") == 0) {
valid_operation = true;
} else if (strcasecmp(operation, "EnumDirectoryPartitions") == 0) {
- valid_operation = true;
+ if (typeid_in != DNSSRV_TYPEID_DWORD) {
+ return WERR_DNS_ERROR_INVALID_PROPERTY;
+ }
+
+ *typeid_out = DNSSRV_TYPEID_DP_LIST;
+ rout->DirectoryPartitionList = talloc_zero(mem_ctx, struct DNS_RPC_DP_LIST);
+
+ if (rin->Dword != 0) {
+ rout->DirectoryPartitionList->dwDpCount = 0;
+ rout->DirectoryPartitionList->DpArray = NULL;
+ } else {
+ struct DNS_RPC_DP_ENUM **dplist;
+ struct dnsserver_partition *p;
+ int pcount = 2;
+
+ dplist = talloc_zero_array(mem_ctx, struct DNS_RPC_DP_ENUM *, pcount);
+ if (dplist == NULL) {
+ return WERR_NOMEM;
+ }
+
+ p = dsstate->partitions;
+ for (i=0; i<pcount; i++) {
+ dplist[i] = talloc_zero(dplist, struct DNS_RPC_DP_ENUM);
+
+ dplist[i]->pszDpFqdn = talloc_strdup(mem_ctx, p->pszDpFqdn);
+ dplist[i]->dwFlags = p->dwDpFlags;
+ dplist[i]->dwZoneCount = p->zones_count;
+ p = p->next;
+ }
+
+ rout->DirectoryPartitionList->dwDpCount = pcount;
+ rout->DirectoryPartitionList->DpArray = dplist;
+ }
+ return WERR_OK;
} else if (strcasecmp(operation, "DirectoryPartitionInfo") == 0) {
valid_operation = true;
} else if (strcasecmp(operation, "Statistics") == 0) {
diff --git a/source4/rpc_server/dnsserver/dnsdb.c b/source4/rpc_server/dnsserver/dnsdb.c
index a181e069b6..707f7b842c 100644
--- a/source4/rpc_server/dnsserver/dnsdb.c
+++ b/source4/rpc_server/dnsserver/dnsdb.c
@@ -75,6 +75,8 @@ failed:
}
+
+/* Search for all dnsZone records */
struct dnsserver_zone *dnsserver_db_enumerate_zones(TALLOC_CTX *mem_ctx,
struct ldb_context *samdb,
struct dnsserver_partition *p)