summaryrefslogtreecommitdiff
path: root/source4/dsdb/kcc
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2013-06-10 12:22:40 +1000
committerStefan Metzmacher <metze@samba.org>2013-06-12 10:02:07 +0200
commite461ff530046199b7e647b81d6dfb2746f68b0d7 (patch)
treea87611621936d636f9b4dc7768f680464f8943f3 /source4/dsdb/kcc
parenteec29db7c237c70732f94e33147c960fa8df39fb (diff)
downloadsamba-e461ff530046199b7e647b81d6dfb2746f68b0d7.tar.gz
samba-e461ff530046199b7e647b81d6dfb2746f68b0d7.tar.bz2
samba-e461ff530046199b7e647b81d6dfb2746f68b0d7.zip
dsdb: Allow dsdb_find_dn_by_guid to show deleted DNs
This helps us in the KCC as we need to return the deleted DN for the GUID in DsReplicaGetInfo calls (tested for deleted servers against Windows 2008R2). Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/dsdb/kcc')
-rw-r--r--source4/dsdb/kcc/kcc_connection.c4
-rw-r--r--source4/dsdb/kcc/kcc_drs_replica_info.c10
2 files changed, 10 insertions, 4 deletions
diff --git a/source4/dsdb/kcc/kcc_connection.c b/source4/dsdb/kcc/kcc_connection.c
index ea6383342c..f85ed13f55 100644
--- a/source4/dsdb/kcc/kcc_connection.c
+++ b/source4/dsdb/kcc/kcc_connection.c
@@ -70,7 +70,7 @@ static int kccsrv_add_connection(struct kccsrv_service *s,
ret = LDB_ERR_INVALID_DN_SYNTAX;
goto done;
}
- ret = dsdb_find_dn_by_guid(s->samdb, tmp_ctx, &conn->dsa_guid, &server_dn);
+ ret = dsdb_find_dn_by_guid(s->samdb, tmp_ctx, &conn->dsa_guid, 0, &server_dn);
if (ret != LDB_SUCCESS) {
DEBUG(0, ("failed to find fromServer DN '%s'\n",
GUID_string(tmp_ctx, &conn->dsa_guid)));
@@ -111,7 +111,7 @@ static int kccsrv_delete_connection(struct kccsrv_service *s,
int ret;
tmp_ctx = talloc_new(s);
- ret = dsdb_find_dn_by_guid(s->samdb, tmp_ctx, &conn->obj_guid, &dn);
+ ret = dsdb_find_dn_by_guid(s->samdb, tmp_ctx, &conn->obj_guid, 0, &dn);
if (ret != LDB_SUCCESS) {
DEBUG(0, ("failed to find nTDSConnection's DN: %s\n",
ldb_strerror(ret)));
diff --git a/source4/dsdb/kcc/kcc_drs_replica_info.c b/source4/dsdb/kcc/kcc_drs_replica_info.c
index 7aa7f5a0f4..ac22312a0c 100644
--- a/source4/dsdb/kcc/kcc_drs_replica_info.c
+++ b/source4/dsdb/kcc/kcc_drs_replica_info.c
@@ -533,6 +533,7 @@ static WERROR fill_neighbor_from_repsFrom(TALLOC_CTX *mem_ctx,
neigh->source_dsa_obj_guid = reps_from->source_dsa_obj_guid;
ret = dsdb_find_dn_by_guid(samdb, mem_ctx, &reps_from->source_dsa_obj_guid,
+ DSDB_SEARCH_SHOW_RECYCLED,
&source_dsa_dn);
if (ret != LDB_SUCCESS) {
@@ -544,13 +545,15 @@ static WERROR fill_neighbor_from_repsFrom(TALLOC_CTX *mem_ctx,
neigh->source_dsa_obj_dn = ldb_dn_get_linearized(source_dsa_dn);
neigh->naming_context_dn = ldb_dn_get_linearized(nc_dn);
- if (dsdb_find_guid_by_dn(samdb, nc_dn, &neigh->naming_context_obj_guid)
+ if (dsdb_find_guid_by_dn(samdb, nc_dn,
+ &neigh->naming_context_obj_guid)
!= LDB_SUCCESS) {
return WERR_DS_DRA_INTERNAL_ERROR;
}
if (!GUID_all_zero(&reps_from->transport_guid)) {
ret = dsdb_find_dn_by_guid(samdb, mem_ctx, &reps_from->transport_guid,
+ DSDB_SEARCH_SHOW_RECYCLED,
&transport_obj_dn);
if (ret != LDB_SUCCESS) {
return WERR_DS_DRA_INTERNAL_ERROR;
@@ -668,7 +671,10 @@ static WERROR fill_neighbor_from_repsTo(TALLOC_CTX *mem_ctx,
neigh->last_attempt = reps_to->last_attempt;
neigh->source_dsa_obj_guid = reps_to->source_dsa_obj_guid;
- ret = dsdb_find_dn_by_guid(samdb, mem_ctx, &reps_to->source_dsa_obj_guid, &source_dsa_dn);
+ ret = dsdb_find_dn_by_guid(samdb, mem_ctx,
+ &reps_to->source_dsa_obj_guid,
+ DSDB_SEARCH_SHOW_RECYCLED,
+ &source_dsa_dn);
if (ret != LDB_SUCCESS) {
DEBUG(0,(__location__ ": Failed to find DN for neighbor GUID %s\n",
GUID_string(mem_ctx, &reps_to->source_dsa_obj_guid)));