diff options
author | Simo Sorce <idra@samba.org> | 2005-08-18 15:02:01 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:33:32 -0500 |
commit | 3e4c4cff2177af33efdb15f03a1bbcb639505cee (patch) | |
tree | 852723e443ca41ef6b1d91dd3c11224eddebbd48 /source4/nbt_server | |
parent | a8d51f87620a688a286603766cbb7edb2b7c6e60 (diff) | |
download | samba-3e4c4cff2177af33efdb15f03a1bbcb639505cee.tar.gz samba-3e4c4cff2177af33efdb15f03a1bbcb639505cee.tar.bz2 samba-3e4c4cff2177af33efdb15f03a1bbcb639505cee.zip |
r9391: Convert all the code to use struct ldb_dn to ohandle ldap like distinguished names
Provide more functions to handle DNs in this form
(This used to be commit 692e35b7797e39533dd2a1c4b63d9da30f1eb5ba)
Diffstat (limited to 'source4/nbt_server')
-rw-r--r-- | source4/nbt_server/dgram/netlogon.c | 5 | ||||
-rw-r--r-- | source4/nbt_server/wins/winsdb.c | 8 |
2 files changed, 7 insertions, 6 deletions
diff --git a/source4/nbt_server/dgram/netlogon.c b/source4/nbt_server/dgram/netlogon.c index b484ca4a77..ab2f1cc579 100644 --- a/source4/nbt_server/dgram/netlogon.c +++ b/source4/nbt_server/dgram/netlogon.c @@ -125,10 +125,11 @@ static void nbtd_netlogon_getdc2(struct dgram_mailslot_handler *dgmslot, /* try and find the domain */ ret = gendb_search_dn(samctx, samctx, - samdb_result_string(ref_res[0], "ncName", NULL), + samdb_result_dn(samctx, ref_res[0], "ncName", NULL), &dom_res, dom_attrs); if (ret != 1) { - DEBUG(2,("Unable to find domain from reference '%s' in sam\n", ref_res[0]->dn)); + DEBUG(2,("Unable to find domain from reference '%s' in sam\n", + ldb_dn_linearize(samctx, ref_res[0]->dn))); return; } diff --git a/source4/nbt_server/wins/winsdb.c b/source4/nbt_server/wins/winsdb.c index c46c4c571e..a83c60c3e7 100644 --- a/source4/nbt_server/wins/winsdb.c +++ b/source4/nbt_server/wins/winsdb.c @@ -37,7 +37,7 @@ static BOOL winsdb_save_version(struct wins_server *winssrv) struct ldb_message *msg = ldb_msg_new(winssrv); if (msg == NULL) goto failed; - msg->dn = talloc_strdup(msg, "CN=VERSION"); + msg->dn = ldb_dn_explode(msg, "CN=VERSION"); if (msg->dn == NULL) goto failed; ret |= ldb_msg_add_fmt(ldb, msg, "minVersion", "%llu", winssrv->min_version); @@ -184,7 +184,7 @@ static struct ldb_message *winsdb_message(struct wins_server *winssrv, struct ldb_message *msg = ldb_msg_new(mem_ctx); if (msg == NULL) goto failed; - msg->dn = winsdb_dn(msg, rec->name); + msg->dn = ldb_dn_explode(msg, winsdb_dn(msg, rec->name)); if (msg->dn == NULL) goto failed; ret |= ldb_msg_add_fmt(ldb, msg, "objectClass", "wins"); ret |= ldb_msg_add_fmt(ldb, msg, "active", "%u", rec->state); @@ -272,11 +272,11 @@ uint8_t winsdb_delete(struct wins_server *winssrv, struct winsdb_record *rec) struct ldb_context *ldb = winssrv->wins_db; TALLOC_CTX *tmp_ctx = talloc_new(winssrv); int ret; - const char *dn; + const struct ldb_dn *dn; winsdb_remove_version(winssrv, rec->version); - dn = winsdb_dn(tmp_ctx, rec->name); + dn = ldb_dn_explode(tmp_ctx, winsdb_dn(tmp_ctx, rec->name)); if (dn == NULL) goto failed; ret = ldb_delete(ldb, dn); |