s4-torture: pass down netlogon flags in netr_ServerPasswordSet2 tests.
[kai/samba.git] / source4 / torture / rpc / netlogon.c
index a97fb449d4c790ccdc07d2989deabf58edb2b7c0..f6d7262d1d9f7580b5656b07e2af09ce5c0501eb 100644 (file)
@@ -506,9 +506,10 @@ static DATA_BLOB netlogon_very_rand_pass(TALLOC_CTX *mem_ctx, int len)
 /*
   try a change password for our machine account
 */
-static bool test_SetPassword2(struct torture_context *tctx,
-                             struct dcerpc_pipe *p,
-                             struct cli_credentials *machine_credentials)
+static bool test_SetPassword2_with_flags(struct torture_context *tctx,
+                                        struct dcerpc_pipe *p,
+                                        struct cli_credentials *machine_credentials,
+                                        uint32_t flags)
 {
        struct netr_ServerPasswordSet2 r;
        const char *password;
@@ -520,7 +521,7 @@ static bool test_SetPassword2(struct torture_context *tctx,
        struct netr_CryptPassword new_password;
        struct dcerpc_binding_handle *b = p->binding_handle;
 
-       if (!test_SetupCredentials(p, tctx, machine_credentials, &creds)) {
+       if (!test_SetupCredentials2(p, tctx, flags, machine_credentials, cli_credentials_get_secure_channel_type(machine_credentials), &creds)) {
                return false;
        }
 
@@ -672,6 +673,13 @@ static bool test_SetPassword2(struct torture_context *tctx,
        return true;
 }
 
+static bool test_SetPassword2(struct torture_context *tctx,
+                             struct dcerpc_pipe *p,
+                             struct cli_credentials *machine_credentials)
+{
+       return test_SetPassword2_with_flags(tctx, p, machine_credentials, NETLOGON_NEG_AUTH2_ADS_FLAGS);
+}
+
 static bool test_GetPassword(struct torture_context *tctx,
                             struct dcerpc_pipe *p,
                             struct cli_credentials *machine_credentials)