summaryrefslogtreecommitdiff
path: root/source4/dsdb/kcc
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-01-16 11:49:39 +1100
committerAndrew Tridgell <tridge@samba.org>2010-01-16 14:10:44 +1100
commitc22973d88dbfb46e5c387ff03b7bb66bada7cac3 (patch)
treea58ee16d96af71d5a29033fd275b2c3e4ece973c /source4/dsdb/kcc
parent8342d08f5c3ffd02f54c5d5ace9e76cf551acb51 (diff)
downloadsamba-c22973d88dbfb46e5c387ff03b7bb66bada7cac3.tar.gz
samba-c22973d88dbfb46e5c387ff03b7bb66bada7cac3.tar.bz2
samba-c22973d88dbfb46e5c387ff03b7bb66bada7cac3.zip
s4-kcc: added support for CURSORS info level in DsReplicaGetInfo
Diffstat (limited to 'source4/dsdb/kcc')
-rw-r--r--source4/dsdb/kcc/kcc_drs_replica_info.c37
1 files changed, 34 insertions, 3 deletions
diff --git a/source4/dsdb/kcc/kcc_drs_replica_info.c b/source4/dsdb/kcc/kcc_drs_replica_info.c
index 0b5aa11f58..6d42ec6252 100644
--- a/source4/dsdb/kcc/kcc_drs_replica_info.c
+++ b/source4/dsdb/kcc/kcc_drs_replica_info.c
@@ -34,6 +34,34 @@
#include "librpc/gen_ndr/ndr_drsblobs.h"
#include "param/param.h"
+
+/*
+ get cursors info for a specified DN
+*/
+static WERROR kccdrs_replica_get_info_cursors(TALLOC_CTX *mem_ctx,
+ struct ldb_context *samdb,
+ struct drsuapi_DsReplicaGetInfo *r,
+ union drsuapi_DsReplicaInfo *reply,
+ struct ldb_dn *dn)
+{
+ int ret;
+
+ if (!ldb_dn_validate(dn)) {
+ return WERR_INVALID_PARAMETER;
+ }
+ reply->cursors = talloc(mem_ctx, struct drsuapi_DsReplicaCursorCtr);
+ W_ERROR_HAVE_NO_MEMORY(reply->cursors);
+
+ reply->cursors->reserved = 0;
+
+ ret = dsdb_load_udv_v1(samdb, dn, reply->cursors, &reply->cursors->array, &reply->cursors->count);
+ if (ret != LDB_SUCCESS) {
+ return WERR_DS_DRA_BAD_NC;
+ }
+ return WERR_OK;
+}
+
+
struct ncList {
struct ldb_dn *dn;
struct ncList *prev, *next;
@@ -431,13 +459,16 @@ NTSTATUS kccdrs_replica_get_info(struct irpc_message *msg,
req_src_dsa_guid, nc_list);
break;
- case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02: /* DS_REPL_INFO_REPSTO */
- case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA: /* On MS-DRSR it is DS_REPL_INFO_METADATA_FOR_OBJ */
- case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2: /* On MS-DRSR it is DS_REPL_INFO_METADATA_FOR_OBJ */
case DRSUAPI_DS_REPLICA_INFO_CURSORS: /* On MS-DRSR it is DS_REPL_INFO_CURSORS_FOR_NC */
+ status = kccdrs_replica_get_info_cursors(mem_ctx, samdb, req, reply,
+ ldb_dn_new(mem_ctx, samdb, object_dn));
+ break;
case DRSUAPI_DS_REPLICA_INFO_CURSORS2: /* On MS-DRSR it is DS_REPL_INFO_CURSORS_2_FOR_NC */
case DRSUAPI_DS_REPLICA_INFO_CURSORS3: /* On MS-DRSR it is DS_REPL_INFO_CURSORS_3_FOR_NC */
case DRSUAPI_DS_REPLICA_INFO_CURSORS05: /* On MS-DRSR it is DS_REPL_INFO_UPTODATE_VECTOR_V1 */
+ case DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02: /* DS_REPL_INFO_REPSTO */
+ case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA: /* On MS-DRSR it is DS_REPL_INFO_METADATA_FOR_OBJ */
+ case DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2: /* On MS-DRSR it is DS_REPL_INFO_METADATA_FOR_OBJ */
case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA: /* On MS-DRSR it is DS_REPL_INFO_METADATA_FOR_ATTR_VALUE */
case DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2: /* On MS-DRSR it is DS_REPL_INFO_METADATA_2_FOR_ATTR_VALUE */
case DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES: /* On MS-DRSR it is DS_REPL_INFO_KCC_DSA_CONNECT_FAILURES */