summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatoliy Atanasov <anatoliy.atanasov@postpath.com>2009-09-23 15:47:14 -0700
committerAnatoliy Atanasov <anatoliy.atanasov@postpath.com>2009-09-23 15:50:51 -0700
commitc9dc6506e626611283756a0f426e23b8a456dc25 (patch)
tree1c0b5e1fab43821375231b72ffcf46d1f42d8b33
parent5925e2952c391aba48c49426a176677a9f623fc2 (diff)
downloadsamba-c9dc6506e626611283756a0f426e23b8a456dc25.tar.gz
samba-c9dc6506e626611283756a0f426e23b8a456dc25.tar.bz2
samba-c9dc6506e626611283756a0f426e23b8a456dc25.zip
s4: Handle DRSUAPI_DS_REPLICA_NEIGHBOUR_CRITICAL_ONLY req in getncchanges
-rw-r--r--librpc/idl/drsuapi.idl8
-rw-r--r--source4/rpc_server/drsuapi/dcesrv_drsuapi.h2
-rw-r--r--source4/rpc_server/drsuapi/drsutil.c7
-rw-r--r--source4/rpc_server/drsuapi/getncchanges.c16
4 files changed, 21 insertions, 12 deletions
diff --git a/librpc/idl/drsuapi.idl b/librpc/idl/drsuapi.idl
index a5aab1360a..27d3089bf7 100644
--- a/librpc/idl/drsuapi.idl
+++ b/librpc/idl/drsuapi.idl
@@ -224,11 +224,15 @@ interface drsuapi
DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP = 0x00000020,
DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS = 0x00000040,
DRSUAPI_DS_REPLICA_NEIGHBOUR_USE_ASYNC_INTERSIDE_TRANSPORT = 0x00000080,
+ DRSUAPI_DS_REPLICA_NEIGHBOUR_ASYNC_REP = 0x00000100,
+ DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_ERROR = 0x00000100,
DRSUAPI_DS_REPLICA_NEIGHBOUR_TWO_WAY_SYNC = 0x00000200,
- DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS = 0x00000800,
+ DRSUAPI_DS_REPLICA_NEIGHBOUR_CRITICAL_ONLY = 0x00000400,
+ DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS = 0x00000800,/*Include updates to ancestor objects before updates to their descendants*/
DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_IN_PROGRESS = 0x00010000,
- DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_NEXT_PACKET = 0x00020000,
+ DRSUAPI_DS_REPLICA_NEIGHBOUR_FULL_SYNC_PACKET = 0x00020000,
DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED = 0x00200000,
+ DRSUAPI_DS_REPLICA_NEIGHBOUR_SPECIAL_SECRET_PROCESSING = 0x00800000,
DRSUAPI_DS_REPLICA_NEIGHBOUR_PREEMPTED = 0x01000000,
DRSUAPI_DS_REPLICA_NEIGHBOUR_IGNORE_CHANGE_NOTIFICATIONS = 0x04000000,
DRSUAPI_DS_REPLICA_NEIGHBOUR_DISABLE_SCHEDULED_SYNC = 0x08000000,
diff --git a/source4/rpc_server/drsuapi/dcesrv_drsuapi.h b/source4/rpc_server/drsuapi/dcesrv_drsuapi.h
index a6b11c5dac..40978629fa 100644
--- a/source4/rpc_server/drsuapi/dcesrv_drsuapi.h
+++ b/source4/rpc_server/drsuapi/dcesrv_drsuapi.h
@@ -55,7 +55,7 @@ int drsuapi_search_with_extended_dn(struct ldb_context *ldb,
enum ldb_scope scope,
const char * const *attrs,
const char *sort_attrib,
- const char *format, ...) PRINTF_ATTRIBUTE(8,9);
+ const char *filter);
WERROR drs_security_level_check(struct dcesrv_call_state *dce_call,
const char* call);
diff --git a/source4/rpc_server/drsuapi/drsutil.c b/source4/rpc_server/drsuapi/drsutil.c
index e1d6bedd99..c78ebdd5fe 100644
--- a/source4/rpc_server/drsuapi/drsutil.c
+++ b/source4/rpc_server/drsuapi/drsutil.c
@@ -50,12 +50,11 @@ int drsuapi_search_with_extended_dn(struct ldb_context *ldb,
enum ldb_scope scope,
const char * const *attrs,
const char *sort_attrib,
- const char *format, ...)
+ const char *filter)
{
va_list ap;
int ret;
struct ldb_request *req;
- char *filter;
TALLOC_CTX *tmp_ctx;
struct ldb_result *res;
@@ -66,10 +65,6 @@ int drsuapi_search_with_extended_dn(struct ldb_context *ldb,
return LDB_ERR_OPERATIONS_ERROR;
}
- va_start(ap, format);
- filter = talloc_vasprintf(tmp_ctx, format, ap);
- va_end(ap);
-
if (filter == NULL) {
talloc_free(tmp_ctx);
return LDB_ERR_OPERATIONS_ERROR;
diff --git a/source4/rpc_server/drsuapi/getncchanges.c b/source4/rpc_server/drsuapi/getncchanges.c
index f38f95c044..75f5651791 100644
--- a/source4/rpc_server/drsuapi/getncchanges.c
+++ b/source4/rpc_server/drsuapi/getncchanges.c
@@ -306,7 +306,8 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct dcesrv_call_state *dce_call, TALLOC_
DATA_BLOB session_key;
const char *attrs[] = { "*", "parentGUID", "distinguishedName", NULL };
WERROR werr;
-
+ char* search_filter;
+
*r->out.level_out = 6;
/* TODO: linked attributes*/
r->out.ctr->ctr6.linked_attributes_count = 0;
@@ -355,12 +356,21 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct dcesrv_call_state *dce_call, TALLOC_
}
/* Construct response. */
+ search_filter = talloc_asprintf(mem_ctx,
+ "(uSNChanged>=%llu)",
+ (unsigned long long)(r->in.req->req8.highwatermark.highest_usn+1));
+
+ if ((r->in.req->req8.replica_flags & DRSUAPI_DS_REPLICA_NEIGHBOUR_CRITICAL_ONLY)
+ == DRSUAPI_DS_REPLICA_NEIGHBOUR_CRITICAL_ONLY) {
+ search_filter = talloc_asprintf(mem_ctx,
+ "(&%s(isCriticalSystemObject=true))",
+ search_filter);
+ }
ncRoot_dn = ldb_dn_new(mem_ctx, sam_ctx, ncRoot->dn);
ret = drsuapi_search_with_extended_dn(sam_ctx, mem_ctx, &site_res,
ncRoot_dn, LDB_SCOPE_SUBTREE, attrs,
"distinguishedName",
- "(uSNChanged>=%llu)",
- (unsigned long long)(r->in.req->req8.highwatermark.highest_usn+1));
+ search_filter);
if (ret != LDB_SUCCESS) {
return WERR_DS_DRA_INTERNAL_ERROR;
}