1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

autorid: initialize: use the split db_open and init_hwms function instead of db_init

This way, we can later put all of the storing functions inside one transaction.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Michael Adam 2014-03-21 00:07:07 +01:00 committed by Jeremy Allison
parent 90d8e0f8bc
commit e9796edaa8

View File

@ -650,7 +650,7 @@ static NTSTATUS idmap_autorid_initialize(struct idmap_domain *dom)
commonconfig->rw_ops->get_new_id = idmap_autorid_allocate_id;
commonconfig->rw_ops->set_mapping = idmap_tdb_common_set_mapping;
status = idmap_autorid_db_init(state_path("autorid.tdb"),
status = idmap_autorid_db_open(state_path("autorid.tdb"),
NULL, /* TALLOC_CTX */
&autorid_db);
if (!NT_STATUS_IS_OK(status)) {
@ -659,6 +659,11 @@ static NTSTATUS idmap_autorid_initialize(struct idmap_domain *dom)
commonconfig->db = autorid_db;
status = idmap_autorid_init_hwms(autorid_db);
if (!NT_STATUS_IS_OK(status)) {
goto error;
}
status = idmap_autorid_saveconfig(autorid_db, config);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(1, ("Failed to store configuration data!\n"));