summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/partition.c24
-rw-r--r--source4/dsdb/samdb/ldb_modules/partition_init.c19
2 files changed, 26 insertions, 17 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c
index 9d59b5437d..19bd03633a 100644
--- a/source4/dsdb/samdb/ldb_modules/partition.c
+++ b/source4/dsdb/samdb/ldb_modules/partition.c
@@ -41,8 +41,8 @@ struct partition_context {
struct ldb_request *req;
struct part_request *part_req;
- int num_requests;
- int finished_requests;
+ unsigned int num_requests;
+ unsigned int finished_requests;
const char **referrals;
};
@@ -91,7 +91,7 @@ static struct dsdb_partition *find_partition(struct partition_private_data *data
struct ldb_dn *dn,
struct ldb_request *req)
{
- int i;
+ unsigned int i;
struct ldb_control *partition_ctrl;
/* see if the request has the partition DN specified in a
@@ -365,7 +365,7 @@ static int partition_send_all(struct ldb_module *module,
struct partition_context *ac,
struct ldb_request *req)
{
- int i;
+ unsigned int i;
struct partition_private_data *data = talloc_get_type(module->private_data,
struct partition_private_data);
int ret = partition_prep_request(ac, NULL);
@@ -390,7 +390,7 @@ static int partition_send_all(struct ldb_module *module,
static int partition_replicate(struct ldb_module *module, struct ldb_request *req, struct ldb_dn *dn)
{
struct partition_context *ac;
- unsigned i;
+ unsigned int i;
int ret;
struct dsdb_partition *partition;
struct partition_private_data *data = talloc_get_type(module->private_data,
@@ -710,7 +710,8 @@ static int partition_rename(struct ldb_module *module, struct ldb_request *req)
/* start a transaction */
static int partition_start_trans(struct ldb_module *module)
{
- int i, ret;
+ unsigned int i;
+ int ret;
struct partition_private_data *data = talloc_get_type(module->private_data,
struct partition_private_data);
/* Look at base DN */
@@ -753,7 +754,7 @@ static int partition_start_trans(struct ldb_module *module)
/* prepare for a commit */
static int partition_prepare_commit(struct ldb_module *module)
{
- int i;
+ unsigned int i;
struct partition_private_data *data = talloc_get_type(module->private_data,
struct partition_private_data);
@@ -783,7 +784,8 @@ static int partition_prepare_commit(struct ldb_module *module)
/* end a transaction */
static int partition_end_trans(struct ldb_module *module)
{
- int i, ret, ret2;
+ int ret, ret2;
+ unsigned int i;
struct partition_private_data *data = talloc_get_type(module->private_data,
struct partition_private_data);
@@ -823,7 +825,8 @@ static int partition_end_trans(struct ldb_module *module)
/* delete a transaction */
static int partition_del_trans(struct ldb_module *module)
{
- int i, ret, final_ret = LDB_SUCCESS;
+ int ret, final_ret = LDB_SUCCESS;
+ unsigned int i;
struct partition_private_data *data = talloc_get_type(module->private_data,
struct partition_private_data);
for (i=0; data && data->partitions && data->partitions[i]; i++) {
@@ -915,7 +918,8 @@ int partition_primary_sequence_number(struct ldb_module *module, TALLOC_CTX *mem
/* FIXME: This function is still semi-async */
static int partition_sequence_number(struct ldb_module *module, struct ldb_request *req)
{
- int i, ret;
+ int ret;
+ unsigned int i;
uint64_t seq_number = 0;
uint64_t timestamp_sequence = 0;
uint64_t timestamp = 0;
diff --git a/source4/dsdb/samdb/ldb_modules/partition_init.c b/source4/dsdb/samdb/ldb_modules/partition_init.c
index 5dcd88a5db..b3b52e3cb1 100644
--- a/source4/dsdb/samdb/ldb_modules/partition_init.c
+++ b/source4/dsdb/samdb/ldb_modules/partition_init.c
@@ -77,7 +77,7 @@ static int partition_load_replicate_dns(struct ldb_context *ldb, struct partitio
static int partition_load_modules(struct ldb_context *ldb,
struct partition_private_data *data, struct ldb_message *msg)
{
- int i;
+ unsigned int i;
struct ldb_message_element *modules_attributes = ldb_msg_find_element(msg, "modules");
talloc_free(data->modules);
if (!modules_attributes) {
@@ -176,7 +176,7 @@ static int partition_reload_metadata(struct ldb_module *module, struct partition
static const char **find_modules_for_dn(struct partition_private_data *data, struct ldb_dn *dn)
{
- int i;
+ unsigned int i;
struct partition_module *default_mod = NULL;
for (i=0; data->modules && data->modules[i]; i++) {
if (!data->modules[i]->dn) {
@@ -347,7 +347,9 @@ static int partition_register(struct ldb_context *ldb, struct dsdb_control_curre
static int add_partition_to_data(struct ldb_context *ldb, struct partition_private_data *data,
struct dsdb_partition *partition)
{
- int i, ret;
+ unsigned int i;
+ int ret;
+
/* Count the partitions */
for (i=0; data->partitions && data->partitions[i]; i++) { /* noop */};
@@ -374,7 +376,8 @@ int partition_reload_if_required(struct ldb_module *module,
struct partition_private_data *data)
{
uint64_t seq;
- int ret, i;
+ int ret;
+ unsigned int i;
struct ldb_context *ldb = ldb_module_get_ctx(module);
struct ldb_message *msg;
struct ldb_message_element *partition_attributes;
@@ -412,7 +415,7 @@ int partition_reload_if_required(struct ldb_module *module,
partition_attributes = ldb_msg_find_element(msg, "partition");
for (i=0; partition_attributes && i < partition_attributes->num_values; i++) {
- int j;
+ unsigned int j;
bool new_partition = true;
const char *filename = NULL;
DATA_BLOB dn_blob;
@@ -536,7 +539,8 @@ static int new_partition_set_replicated_metadata(struct ldb_context *ldb,
struct partition_private_data *data,
struct dsdb_partition *partition)
{
- int i, ret;
+ unsigned int i;
+ int ret;
/* for each replicate, copy from main partition. If we get an error, we report it up the chain */
for (i=0; data->replicate && data->replicate[i]; i++) {
struct ldb_result *replicate_res;
@@ -664,7 +668,8 @@ static int new_partition_set_replicated_metadata(struct ldb_context *ldb,
* instanceType */
int partition_create(struct ldb_module *module, struct ldb_request *req)
{
- int i, ret;
+ unsigned int i;
+ int ret;
struct ldb_context *ldb = ldb_module_get_ctx(module);
struct ldb_request *mod_req, *last_req = req;
struct ldb_message *mod_msg;