r25026: Move param/param.h out of includes.h
[abartlet/samba.git/.git] / source4 / torture / rpc / samlogon.c
index 2baeda5a75ca2cf97ca7a10a2b1d91cce27e8784..b149af18597468374bd4bdcdfdda8b357b8314d5 100644 (file)
@@ -31,6 +31,7 @@
 #include "torture/rpc/rpc.h"
 #include "auth/gensec/schannel_proto.h"
 #include "libcli/auth/libcli_auth.h"
+#include "param/param.h"
 
 #define TEST_MACHINE_NAME "samlogontest"
 #define TEST_USER_NAME "samlogontestuser"
@@ -146,7 +147,7 @@ static NTSTATUS check_samlogon(struct samlogon_state *samlogon_state,
        }
        
        switch (samlogon_state->function_level) {
-       case DCERPC_NETR_LOGONSAMLOGON: 
+       case NDR_NETR_LOGONSAMLOGON: 
                ZERO_STRUCT(samlogon_state->auth2);
                creds_client_authenticator(samlogon_state->creds, &samlogon_state->auth);
 
@@ -179,7 +180,7 @@ static NTSTATUS check_samlogon(struct samlogon_state *samlogon_state,
                        break;
                }
                break;
-       case DCERPC_NETR_LOGONSAMLOGONEX: 
+       case NDR_NETR_LOGONSAMLOGONEX: 
                status = dcerpc_netr_LogonSamLogonEx(samlogon_state->p, samlogon_state->mem_ctx, r_ex);
                if (!NT_STATUS_IS_OK(status)) {
                        if (error_string) {
@@ -204,7 +205,7 @@ static NTSTATUS check_samlogon(struct samlogon_state *samlogon_state,
                        break;
                }
                break;
-       case DCERPC_NETR_LOGONSAMLOGONWITHFLAGS: 
+       case NDR_NETR_LOGONSAMLOGONWITHFLAGS: 
                ZERO_STRUCT(samlogon_state->auth2);
                creds_client_authenticator(samlogon_state->creds, &samlogon_state->auth);
 
@@ -1320,9 +1321,9 @@ static BOOL test_SamLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
        int validation_levels[] = {2,3,6};
        int logon_levels[] = { 2, 6 };
        int function_levels[] = { 
-               DCERPC_NETR_LOGONSAMLOGON,
-               DCERPC_NETR_LOGONSAMLOGONEX,
-               DCERPC_NETR_LOGONSAMLOGONWITHFLAGS };
+               NDR_NETR_LOGONSAMLOGON,
+               NDR_NETR_LOGONSAMLOGONEX,
+               NDR_NETR_LOGONSAMLOGONWITHFLAGS };
        struct samlogon_state samlogon_state;
        
        d_printf("testing netr_LogonSamLogon and netr_LogonSamLogonWithFlags\n");
@@ -1484,7 +1485,6 @@ BOOL torture_rpc_samlogon(struct torture_context *torture)
        char *user_password, *user_password_wrong_wks, *user_password_wrong_time;
        const char *old_user_password;
        char *test_machine_account;
-       const char *binding = torture_setting_string(torture, "binding", NULL);
        const char *userdomain;
        struct samr_SetUserInfo s;
        union samr_UserInfo u;
@@ -1514,7 +1514,8 @@ BOOL torture_rpc_samlogon(struct torture_context *torture)
 
        userdomain = torture_setting_string(torture, "userdomain", lp_workgroup());
 
-       user_ctx = torture_create_testuser(TEST_USER_NAME,
+       user_ctx = torture_create_testuser(torture,
+                                          TEST_USER_NAME,
                                           userdomain,
                                           ACB_NORMAL, 
                                           (const char **)&user_password);
@@ -1529,7 +1530,8 @@ BOOL torture_rpc_samlogon(struct torture_context *torture)
                                 TEST_USER_NAME, 16 /* > 14 */, &user_password, 
                                 NULL, 0, False);
 
-       user_ctx_wrong_wks = torture_create_testuser(TEST_USER_NAME_WRONG_WKS,
+       user_ctx_wrong_wks = torture_create_testuser(torture,
+                                                    TEST_USER_NAME_WRONG_WKS,
                                           userdomain,
                                           ACB_NORMAL, 
                                           (const char **)&user_password_wrong_wks);
@@ -1554,7 +1556,7 @@ BOOL torture_rpc_samlogon(struct torture_context *torture)
        }
 
        user_ctx_wrong_time
-               = torture_create_testuser(TEST_USER_NAME_WRONG_TIME,
+               = torture_create_testuser(torture, TEST_USER_NAME_WRONG_TIME,
                                           userdomain,
                                           ACB_NORMAL, 
                                           (const char **)&user_password_wrong_time);
@@ -1580,9 +1582,8 @@ BOOL torture_rpc_samlogon(struct torture_context *torture)
                goto failed;
        }
 
-       status = dcerpc_parse_binding(mem_ctx, binding, &b);
+       status = torture_rpc_binding(torture, &b);
        if (!NT_STATUS_IS_OK(status)) {
-               d_printf("Bad binding string %s\n", binding);
                ret = False;
                goto failed;
        }
@@ -1594,7 +1595,7 @@ BOOL torture_rpc_samlogon(struct torture_context *torture)
        b->flags |= DCERPC_SCHANNEL | DCERPC_SIGN | DCERPC_SCHANNEL_128;
 
        status = dcerpc_pipe_connect_b(mem_ctx, &p, b, 
-                                                                  &dcerpc_table_netlogon,
+                                      &ndr_table_netlogon,
                                       machine_credentials, NULL);
 
        if (!NT_STATUS_IS_OK(status)) {