summaryrefslogtreecommitdiff
path: root/source4/wrepl_server/wrepl_server.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-12-17 15:45:38 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:28 -0500
commit736543016e35882d2ad784c3598a3e8c2c7fcc7b (patch)
tree165908bc76070ffd14c39bc79ea6e09199bba5ba /source4/wrepl_server/wrepl_server.c
parent356eed3fe816c4058de5eda79d1087b8a54e62cc (diff)
downloadsamba-736543016e35882d2ad784c3598a3e8c2c7fcc7b.tar.gz
samba-736543016e35882d2ad784c3598a3e8c2c7fcc7b.tar.bz2
samba-736543016e35882d2ad784c3598a3e8c2c7fcc7b.zip
r12304: split out the wins partner configuration into a seperate ldb.
now $privatedir/wins_config.ldb contains the wins partners and $lockdir/wins.ldb contains the name records metze (This used to be commit baa4a7a9d4f16adf476846850a63dfbfd51b10b3)
Diffstat (limited to 'source4/wrepl_server/wrepl_server.c')
-rw-r--r--source4/wrepl_server/wrepl_server.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source4/wrepl_server/wrepl_server.c b/source4/wrepl_server/wrepl_server.c
index 157a39ec85..3b800333ed 100644
--- a/source4/wrepl_server/wrepl_server.c
+++ b/source4/wrepl_server/wrepl_server.c
@@ -33,6 +33,12 @@
#include "ldb/include/ldb.h"
#include "ldb/include/ldb_errors.h"
+static struct ldb_context *wins_config_db_connect(TALLOC_CTX *mem_ctx)
+{
+ return ldb_wrap_connect(mem_ctx, private_path(mem_ctx, lp_wins_config_url()),
+ system_session(mem_ctx), NULL, 0, NULL);
+}
+
/*
open winsdb
*/
@@ -43,6 +49,11 @@ static NTSTATUS wreplsrv_open_winsdb(struct wreplsrv_service *service)
return NT_STATUS_INTERNAL_DB_ERROR;
}
+ service->config.ldb = wins_config_db_connect(service);
+ if (!service->config.ldb) {
+ return NT_STATUS_INTERNAL_DB_ERROR;
+ }
+
/* the default renew interval is 6 days */
service->config.renew_interval = lp_parm_int(-1,"wreplsrv","renew_interval", 6*24*60*60);
@@ -85,7 +96,7 @@ static NTSTATUS wreplsrv_load_partners(struct wreplsrv_service *service)
int i;
/* find the record in the WINS database */
- ret = ldb_search(service->wins_db, ldb_dn_explode(tmp_ctx, "CN=PARTNERS"), LDB_SCOPE_ONELEVEL,
+ ret = ldb_search(service->config.ldb, ldb_dn_explode(tmp_ctx, "CN=PARTNERS"), LDB_SCOPE_SUBTREE,
"(objectClass=wreplPartner)", NULL, &res);
if (ret != LDB_SUCCESS) goto failed;
talloc_steal(tmp_ctx, res);