dsdb: Align integer types
authorVolker Lendecke <vl@samba.org>
Sun, 1 Dec 2019 15:21:12 +0000 (16:21 +0100)
committerDavid Disseldorp <ddiss@samba.org>
Fri, 3 Jan 2020 00:04:43 +0000 (00:04 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
source4/dsdb/samdb/ldb_modules/encrypted_secrets.c
source4/dsdb/samdb/ldb_modules/tests/test_encrypted_secrets.c

index 7e6d4b160d479d56106d673283fcc316109a696f..d3ce7e31642121bf21fe2f9778914c507ade3bff 100644 (file)
@@ -263,7 +263,7 @@ static int load_keys(struct ldb_module *module, struct es_data *data)
  */
 static bool should_encrypt(const struct ldb_message_element *el)
 {
-       int i;
+       size_t i;
 
        for (i = 0; i < ARRAY_SIZE(secret_attributes); i++) {
                if (strcasecmp(secret_attributes[i], el->name) == 0) {
@@ -748,7 +748,7 @@ static struct ldb_message_element *encrypt_element(
        const struct es_data *data)
 {
        struct ldb_message_element* enc;
-       int i;
+       unsigned int i;
 
        enc = talloc_zero(ctx, struct ldb_message_element);
        if (enc == NULL) {
@@ -818,10 +818,9 @@ static const struct ldb_message *encrypt_secret_attributes(
        const struct ldb_message *msg,
        const struct es_data *data)
 {
-
        struct ldb_message *encrypted_msg = NULL;
 
-       int i;
+       unsigned int i;
 
        if (ldb_dn_is_special(msg->dn)) {
                return NULL;
@@ -1003,7 +1002,7 @@ static struct ldb_message_element *decrypt_element(
        struct ldb_message_element* el,
        struct es_data *data)
 {
-       int i;
+       unsigned int i;
        struct ldb_message_element* dec =
                talloc_zero(ctx, struct ldb_message_element);
 
@@ -1069,8 +1068,8 @@ static int decrypt_secret_attributes(struct ldb_context *ldb,
                                      struct ldb_message *msg,
                                      struct es_data *data)
 {
-
-       int i, ret;
+       size_t i;
+       int ret;
 
        if (ldb_dn_is_special(msg->dn)) {
                return LDB_SUCCESS;
index 6357deab7ce57adf21c984fe20c74017f30d9071..e639d4cbb0acac9cdc279331140276bc7ea16f5d 100644 (file)
@@ -672,7 +672,8 @@ static void test_message_encryption_decryption(void **state)
                struct es_data);
        struct ldb_message_element *el = NULL;
        int ret = LDB_SUCCESS;
-       int i, j;
+       size_t i;
+       unsigned int j;
 
        msg->dn = ldb_dn_new(msg, ldb, "dc=test");
        ldb_msg_add_string(msg, "cmocka_test_name01", "value01");