summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-07-08 15:10:07 +0200
committerStefan Metzmacher <metze@samba.org>2010-07-09 09:27:14 +0200
commit3b8c9276dcfa349013450c18d09bfd1b78e6224e (patch)
tree536da208af10f5088bb7b04332783198387fe020 /source4/dsdb/samdb/ldb_modules
parent12d26d59bddaa7d3469b4e9ecab4146a9ea67180 (diff)
downloadsamba-3b8c9276dcfa349013450c18d09bfd1b78e6224e.tar.gz
samba-3b8c9276dcfa349013450c18d09bfd1b78e6224e.tar.bz2
samba-3b8c9276dcfa349013450c18d09bfd1b78e6224e.zip
s4:dsdb:ridalloc: use ridalloc_ridset_values infrastructure in ridalloc_create_rid_set_ntds()
metze
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r--source4/dsdb/samdb/ldb_modules/ridalloc.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/ridalloc.c b/source4/dsdb/samdb/ldb_modules/ridalloc.c
index 2ba3edb9cb..6b5f2f9f1d 100644
--- a/source4/dsdb/samdb/ldb_modules/ridalloc.c
+++ b/source4/dsdb/samdb/ldb_modules/ridalloc.c
@@ -246,9 +246,20 @@ static int ridalloc_create_rid_set_ntds(struct ldb_module *module, TALLOC_CTX *m
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
struct ldb_dn *server_dn, *machine_dn, *rid_set_dn;
int ret;
- uint64_t dc_pool;
struct ldb_message *msg;
struct ldb_context *ldb = ldb_module_get_ctx(module);
+ static const struct ridalloc_ridset_values o = {
+ .alloc_pool = UINT64_MAX,
+ .prev_pool = UINT64_MAX,
+ .next_rid = UINT32_MAX,
+ .used_pool = UINT32_MAX,
+ };
+ struct ridalloc_ridset_values n = {
+ .alloc_pool = 0,
+ .prev_pool = 0,
+ .next_rid = 0,
+ .used_pool = 0,
+ };
/*
steps:
@@ -287,7 +298,7 @@ static int ridalloc_create_rid_set_ntds(struct ldb_module *module, TALLOC_CTX *m
}
/* grab a pool from the RID Manager object */
- ret = ridalloc_rid_manager_allocate(module, rid_manager_dn, &dc_pool);
+ ret = ridalloc_rid_manager_allocate(module, rid_manager_dn, &n.alloc_pool);
if (ret != LDB_SUCCESS) {
talloc_free(tmp_ctx);
return ret;
@@ -302,24 +313,8 @@ static int ridalloc_create_rid_set_ntds(struct ldb_module *module, TALLOC_CTX *m
talloc_free(tmp_ctx);
return ret;
}
- ret = ldb_msg_add_fmt(msg, "rIDAllocationPool", "%llu", (unsigned long long)dc_pool);
- if (ret != LDB_SUCCESS) {
- talloc_free(tmp_ctx);
- return ret;
- }
- /* w2k8-r2 sets these to zero when first created */
- ret = ldb_msg_add_fmt(msg, "rIDPreviousAllocationPool", "0");
- if (ret != LDB_SUCCESS) {
- talloc_free(tmp_ctx);
- return ret;
- }
- ret = ldb_msg_add_fmt(msg, "rIDUsedPool", "0");
- if (ret != LDB_SUCCESS) {
- talloc_free(tmp_ctx);
- return ret;
- }
- ret = ldb_msg_add_fmt(msg, "rIDNextRID", "0");
+ ret = ridalloc_set_ridset_values(module, msg, &o, &n);
if (ret != LDB_SUCCESS) {
talloc_free(tmp_ctx);
return ret;