summaryrefslogtreecommitdiff
path: root/source4/dsdb/kcc
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-02-16 15:40:44 +1100
committerAndrew Tridgell <tridge@samba.org>2010-02-16 21:10:51 +1100
commitb630530730a710b7e850be2f848b1b85dbc25b4d (patch)
treece0c7edc9073fd1b4221e1e87043b4d5a6a35202 /source4/dsdb/kcc
parent8f4a34272eb26e7c86ce8c0e158b5f6eabd10234 (diff)
downloadsamba-b630530730a710b7e850be2f848b1b85dbc25b4d.tar.gz
samba-b630530730a710b7e850be2f848b1b85dbc25b4d.tar.bz2
samba-b630530730a710b7e850be2f848b1b85dbc25b4d.zip
s4-dsdb: added dsdb_search_one() and cleanup dsdb_find_dn_by_guid()
dsdb_find_dn_by_guid() now takes a struct GUID instead of a guid_string. All the callers in fact wanted a struct GUID, so we now avoid the extra conversion. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/kcc')
-rw-r--r--source4/dsdb/kcc/kcc_connection.c6
-rw-r--r--source4/dsdb/kcc/kcc_drs_replica_info.c19
2 files changed, 7 insertions, 18 deletions
diff --git a/source4/dsdb/kcc/kcc_connection.c b/source4/dsdb/kcc/kcc_connection.c
index 73198040c4..d0d549dc1f 100644
--- a/source4/dsdb/kcc/kcc_connection.c
+++ b/source4/dsdb/kcc/kcc_connection.c
@@ -65,8 +65,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, GUID_string(tmp_ctx,
- &conn->dsa_guid), &server_dn);
+ ret = dsdb_find_dn_by_guid(s->samdb, tmp_ctx, &conn->dsa_guid, &server_dn);
if (ret != LDB_SUCCESS) {
DEBUG(0, ("failed to find fromServer DN '%s'\n",
GUID_string(tmp_ctx, &conn->dsa_guid)));
@@ -105,8 +104,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,
- GUID_string(tmp_ctx, &conn->obj_guid), &dn);
+ ret = dsdb_find_dn_by_guid(s->samdb, tmp_ctx, &conn->obj_guid, &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 da89a470a3..c35664905f 100644
--- a/source4/dsdb/kcc/kcc_drs_replica_info.c
+++ b/source4/dsdb/kcc/kcc_drs_replica_info.c
@@ -254,7 +254,6 @@ static WERROR fill_neighbor_from_repsFrom(TALLOC_CTX *mem_ctx,
{
struct ldb_dn *source_dsa_dn;
int ret;
- char *dsa_guid_str;
struct ldb_dn *transport_obj_dn = NULL;
neigh->source_dsa_address = reps_from->other_info->dns_name1;
@@ -262,13 +261,11 @@ static WERROR fill_neighbor_from_repsFrom(TALLOC_CTX *mem_ctx,
neigh->last_attempt = reps_from->last_attempt;
neigh->source_dsa_obj_guid = reps_from->source_dsa_obj_guid;
- dsa_guid_str = GUID_string(mem_ctx, &reps_from->source_dsa_obj_guid);
- W_ERROR_HAVE_NO_MEMORY(dsa_guid_str);
- ret = dsdb_find_dn_by_guid(samdb, mem_ctx, dsa_guid_str, &source_dsa_dn);
+ ret = dsdb_find_dn_by_guid(samdb, mem_ctx, &reps_from->source_dsa_obj_guid, &source_dsa_dn);
if (ret != LDB_SUCCESS) {
DEBUG(0,(__location__ ": Failed to find DN for neighbor GUID %s\n",
- dsa_guid_str));
+ GUID_string(mem_ctx, &reps_from->source_dsa_obj_guid)));
return WERR_DS_DRA_INTERNAL_ERROR;
}
@@ -281,9 +278,7 @@ static WERROR fill_neighbor_from_repsFrom(TALLOC_CTX *mem_ctx,
}
if (!GUID_all_zero(&reps_from->transport_guid)) {
- char *transp_guid_str = GUID_string(mem_ctx, &reps_from->transport_guid);
- W_ERROR_HAVE_NO_MEMORY(transp_guid_str);
- if (dsdb_find_dn_by_guid(samdb, mem_ctx, transp_guid_str,
+ if (dsdb_find_dn_by_guid(samdb, mem_ctx, &reps_from->transport_guid,
&transport_obj_dn) != LDB_SUCCESS)
{
return WERR_DS_DRA_INTERNAL_ERROR;
@@ -391,7 +386,6 @@ static WERROR fill_neighbor_from_repsTo(TALLOC_CTX *mem_ctx,
struct drsuapi_DsReplicaNeighbour *neigh,
struct repsFromTo2 *reps_to)
{
- char *dsa_guid_str;
int ret;
struct ldb_dn *source_dsa_dn;
@@ -400,13 +394,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;
- dsa_guid_str = GUID_string(mem_ctx, &reps_to->source_dsa_obj_guid);
- W_ERROR_HAVE_NO_MEMORY(dsa_guid_str);
-
- ret = dsdb_find_dn_by_guid(samdb, mem_ctx, dsa_guid_str, &source_dsa_dn);
+ ret = dsdb_find_dn_by_guid(samdb, mem_ctx, &reps_to->source_dsa_obj_guid, &source_dsa_dn);
if (ret != LDB_SUCCESS) {
DEBUG(0,(__location__ ": Failed to find DN for neighbor GUID %s\n",
- dsa_guid_str));
+ GUID_string(mem_ctx, &reps_to->source_dsa_obj_guid)));
return WERR_DS_DRA_INTERNAL_ERROR;
}