diff options
Diffstat (limited to 'source4/dsdb')
-rw-r--r-- | source4/dsdb/common/util.c | 6 | ||||
-rw-r--r-- | source4/dsdb/kcc/kcc_connection.c | 4 | ||||
-rw-r--r-- | source4/dsdb/kcc/kcc_drs_replica_info.c | 10 | ||||
-rw-r--r-- | source4/dsdb/repl/drepl_partitions.c | 2 |
4 files changed, 15 insertions, 7 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index 8e407768ff..7a243c3d37 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -2458,7 +2458,9 @@ struct ldb_dn *samdb_domain_to_dn(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, */ int dsdb_find_dn_by_guid(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, - const struct GUID *guid, struct ldb_dn **dn) + const struct GUID *guid, + uint32_t dsdb_flags, + struct ldb_dn **dn) { int ret; struct ldb_result *res; @@ -2472,7 +2474,7 @@ int dsdb_find_dn_by_guid(struct ldb_context *ldb, ret = dsdb_search(ldb, mem_ctx, &res, NULL, LDB_SCOPE_SUBTREE, attrs, DSDB_SEARCH_SEARCH_ALL_PARTITIONS | DSDB_SEARCH_SHOW_EXTENDED_DN | - DSDB_SEARCH_ONE_ONLY, + DSDB_SEARCH_ONE_ONLY | dsdb_flags, "objectGUID=%s", guid_str); talloc_free(guid_str); if (ret != LDB_SUCCESS) { 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))); diff --git a/source4/dsdb/repl/drepl_partitions.c b/source4/dsdb/repl/drepl_partitions.c index 2a16a4502f..4c5dde27f7 100644 --- a/source4/dsdb/repl/drepl_partitions.c +++ b/source4/dsdb/repl/drepl_partitions.c @@ -172,7 +172,7 @@ NTSTATUS dreplsrv_get_target_principal(struct dreplsrv_service *s, tmp_ctx = talloc_new(mem_ctx); /* we need to find their hostname */ - ret = dsdb_find_dn_by_guid(s->samdb, tmp_ctx, &rft->source_dsa_obj_guid, &ntds_dn); + ret = dsdb_find_dn_by_guid(s->samdb, tmp_ctx, &rft->source_dsa_obj_guid, 0, &ntds_dn); if (ret != LDB_SUCCESS) { talloc_free(tmp_ctx); /* its OK for their NTDSDSA DN not to be in our database */ |