summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2011-12-15 18:27:39 +1100
committerAmitay Isaacs <amitay@gmail.com>2011-12-23 16:17:10 +1100
commit6a5352da594bcd6c109c883f3db7e307f171f228 (patch)
tree811be9493a6b35402a6e9c33911a269beac49e36
parent5673e2cec946502da84956f866658718e7632a3e (diff)
downloadsamba-6a5352da594bcd6c109c883f3db7e307f171f228.tar.gz
samba-6a5352da594bcd6c109c883f3db7e307f171f228.tar.bz2
samba-6a5352da594bcd6c109c883f3db7e307f171f228.zip
s4:rpc-dnsserver: Implement EnumDirectoryPartition operation
-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)