]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
dsdb: Use ldb_init() to make the ldb_context in dsdb audit tests
authorAndrew Bartlett <abartlet@samba.org>
Thu, 7 Jun 2018 07:50:15 +0000 (09:50 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 9 Jun 2018 15:42:38 +0000 (17:42 +0200)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Jun  9 17:42:38 CEST 2018 on sn-devel-144

source4/dsdb/samdb/ldb_modules/tests/test_audit_log.c
source4/dsdb/samdb/ldb_modules/tests/test_audit_util.c
source4/dsdb/samdb/ldb_modules/tests/test_group_audit.c

index 55e4335efce02cf0c8f56a31ed3851c66e0cb861..3e57af11a82ea3a8743ec889cf16024ee986a352 100644 (file)
@@ -81,7 +81,7 @@ static void test_has_password_changed(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
 
        /*
         * Empty message
@@ -196,7 +196,7 @@ static void test_get_password_action(void **state)
        struct dsdb_control_password_acl_validation *pav = NULL;
 
        TALLOC_CTX *ctx = talloc_new(NULL);
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
 
        /*
         * Add request, will always be a reset
@@ -292,7 +292,7 @@ static void test_operation_json_empty(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
        ac = talloc_zero(ctx, struct audit_context);
 
        module = talloc_zero(ctx, struct ldb_module);
@@ -423,7 +423,7 @@ static void test_operation_json(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
 
        ac = talloc_zero(ctx, struct audit_context);
        GUID_from_string(TRANSACTION, &transaction_id);
@@ -618,7 +618,7 @@ static void test_as_system_operation_json(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
 
        ac = talloc_zero(ctx, struct audit_context);
        GUID_from_string(TRANSACTION, &transaction_id);
@@ -793,7 +793,7 @@ static void test_password_change_json_empty(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
        ac = talloc_zero(ctx, struct audit_context);
 
        module = talloc_zero(ctx, struct ldb_module);
@@ -892,7 +892,7 @@ static void test_password_change_json(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
 
        ac = talloc_zero(ctx, struct audit_context);
        GUID_from_string(TRANSACTION, &transaction_id);
@@ -1151,7 +1151,7 @@ static void test_replicated_update_json_empty(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
        ac = talloc_zero(ctx, struct audit_context);
 
        module = talloc_zero(ctx, struct ldb_module);
@@ -1287,7 +1287,7 @@ static void test_replicated_update_json(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
 
        ac = talloc_zero(ctx, struct audit_context);
        GUID_from_string(TRANSACTION, &transaction_id);
@@ -1419,7 +1419,7 @@ static void test_operation_hr_empty(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
        ac = talloc_zero(ctx, struct audit_context);
 
        module = talloc_zero(ctx, struct ldb_module);
@@ -1491,7 +1491,7 @@ static void test_operation_hr(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
 
        ac = talloc_zero(ctx, struct audit_context);
        GUID_from_string(TRANSACTION, &transaction_id);
@@ -1593,7 +1593,7 @@ static void test_as_system_operation_hr(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
 
        ac = talloc_zero(ctx, struct audit_context);
        GUID_from_string(TRANSACTION, &transaction_id);
@@ -1680,7 +1680,7 @@ static void test_password_change_hr_empty(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
        ac = talloc_zero(ctx, struct audit_context);
 
        module = talloc_zero(ctx, struct ldb_module);
@@ -1749,7 +1749,7 @@ static void test_password_change_hr(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
 
        ac = talloc_zero(ctx, struct audit_context);
        GUID_from_string(TRANSACTION, &transaction_id);
@@ -2081,7 +2081,7 @@ static void test_replicated_update_hr_empty(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
        ac = talloc_zero(ctx, struct audit_context);
 
        module = talloc_zero(ctx, struct ldb_module);
@@ -2155,7 +2155,7 @@ static void test_replicated_update_hr(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
 
        ac = talloc_zero(ctx, struct audit_context);
        GUID_from_string(TRANSACTION, &transaction_id);
index ed27e97330babb46aab8fe3c42de566fd6c1e3c4..c2a27395b4da402d6951685e7b30e1859513f6c9 100644 (file)
@@ -469,7 +469,7 @@ static void test_dsdb_audit_get_remote_address(void **state)
         * Test a freshly initialized ldb
         * should return NULL
         */
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
        ts = dsdb_audit_get_remote_address(ldb);
        assert_null(ts);
 
@@ -503,7 +503,7 @@ static void test_dsdb_audit_get_ldb_error_string(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
        module = talloc_zero(ctx, struct ldb_module);
        module->ldb = ldb;
 
@@ -543,7 +543,7 @@ static void test_dsdb_audit_get_user_sid(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
        module = talloc_zero(ctx, struct ldb_module);
        module->ldb = ldb;
 
@@ -624,7 +624,7 @@ static void test_dsdb_audit_get_actual_sid(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
 
        /*
         * Freshly initialised structures, will be no session data
@@ -703,7 +703,7 @@ static void test_dsdb_audit_is_system_session(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
        module = talloc_zero(ctx, struct ldb_module);
        module->ldb = ldb;
 
@@ -791,7 +791,7 @@ static void test_dsdb_audit_get_unique_session_token(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
        module = talloc_zero(ctx, struct ldb_module);
        module->ldb = ldb;
 
@@ -849,7 +849,7 @@ static void test_dsdb_audit_get_actual_unique_session_token(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
 
        /*
         * Test a freshly initialized ldb
@@ -900,7 +900,7 @@ static void test_dsdb_audit_get_remote_host(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
 
        /*
         * Test a freshly initialized ldb
@@ -946,7 +946,7 @@ static void test_dsdb_audit_get_primary_dn(void **state)
 
        req = talloc_zero(ctx, struct ldb_request);
        msg = talloc_zero(ctx, struct ldb_message);
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
        dn = ldb_dn_new(ctx, ldb, DN);
 
        /*
@@ -1112,7 +1112,7 @@ static void test_dsdb_audit_get_secondary_dn(void **state)
        TALLOC_CTX *ctx = talloc_new(NULL);
 
        req = talloc_zero(ctx, struct ldb_request);
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
        dn = ldb_dn_new(ctx, ldb, DN);
 
        /*
index 566028cab98e157a379622f8db74629987f0184c..26392b7836238edd994f53556241d0b88ef83a09 100644 (file)
@@ -259,7 +259,7 @@ static void test_audit_group_hr(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
 
        GUID_from_string(TRANSACTION, &transaction_id);
 
@@ -627,7 +627,7 @@ static void test_audit_group_json(void **state)
 
        TALLOC_CTX *ctx = talloc_new(NULL);
 
-       ldb = talloc_zero(ctx, struct ldb_context);
+       ldb = ldb_init(ctx, NULL);
 
        GUID_from_string(TRANSACTION, &transaction_id);