[GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
[sfrench/samba-autobuild/.git] / source3 / winbindd / winbindd_pam.c
index f823e1d7b277b04a3f1a5c5f3365eeb4b8424c9f..78128521c44393392604af5a87569efdd78c8b28 100644 (file)
@@ -1261,17 +1261,6 @@ NTSTATUS winbindd_dual_pam_auth_samlogon(struct winbindd_domain *domain,
        /* check authentication loop */
 
        do {
-               NTSTATUS (*logon_fn)(struct rpc_pipe_client
-                                    *cli, TALLOC_CTX *mem_ctx,
-                                    uint32 logon_parameters,
-                                    const char *server,
-                                    const char *username,
-                                    const char *domain,
-                                    const char *workstation, 
-                                    const uint8 chal[8], 
-                                    DATA_BLOB lm_response,
-                                    DATA_BLOB nt_response,
-                                    NET_USER_INFO_3 *info3);
 
                ZERO_STRUCTP(my_info3);
                retry = False;
@@ -1283,11 +1272,7 @@ NTSTATUS winbindd_dual_pam_auth_samlogon(struct winbindd_domain *domain,
                        goto done;
                }
 
-               logon_fn = contact_domain->can_do_samlogon_ex
-                       ? rpccli_netlogon_sam_network_logon_ex
-                       : rpccli_netlogon_sam_network_logon;
-
-               result = logon_fn(netlogon_pipe,
+               result = rpccli_netlogon_sam_network_logon(netlogon_pipe,
                                                           state->mem_ctx,
                                                           0,
                                                           contact_domain->dcname, /* server name */
@@ -1298,16 +1283,6 @@ NTSTATUS winbindd_dual_pam_auth_samlogon(struct winbindd_domain *domain,
                                                           lm_resp,
                                                           nt_resp,
                                                           my_info3);
-
-               if ((NT_STATUS_V(result) == DCERPC_FAULT_OP_RNG_ERROR)
-                   && contact_domain->can_do_samlogon_ex) {
-                       DEBUG(3, ("Got a DC that can not do NetSamLogonEx, "
-                                 "retrying with NetSamLogon\n"));
-                       contact_domain->can_do_samlogon_ex = False;
-                       retry = True;
-                       continue;
-               }
-                       
                attempts += 1;
 
                /* We have to try a second time as cm_connect_netlogon
@@ -1803,18 +1778,6 @@ enum winbindd_result winbindd_dual_pam_auth_crap(struct winbindd_domain *domain,
        }
 
        do {
-               NTSTATUS (*logon_fn)(struct rpc_pipe_client
-                                    *cli, TALLOC_CTX *mem_ctx,
-                                    uint32 logon_parameters,
-                                    const char *server,
-                                    const char *username,
-                                    const char *domain,
-                                    const char *workstation, 
-                                    const uint8 chal[8], 
-                                    DATA_BLOB lm_response,
-                                    DATA_BLOB nt_response,
-                                    NET_USER_INFO_3 *info3);
-
                ZERO_STRUCT(info3);
                retry = False;
 
@@ -1827,32 +1790,19 @@ enum winbindd_result winbindd_dual_pam_auth_crap(struct winbindd_domain *domain,
                        goto done;
                }
 
-               logon_fn = contact_domain->can_do_samlogon_ex
-                       ? rpccli_netlogon_sam_network_logon_ex
-                       : rpccli_netlogon_sam_network_logon;
-
-               result = logon_fn(netlogon_pipe,
-                                 state->mem_ctx,
-                                 state->request.data.auth_crap.logon_parameters,
-                                 contact_domain->dcname,
-                                 name_user,
-                                 name_domain, 
-                                       /* Bug #3248 - found by Stefan Burkei. */
-                                 workstation, /* We carefully set this above so use it... */
-                                 state->request.data.auth_crap.chal,
-                                 lm_resp,
-                                 nt_resp,
-                                 &info3);
-
-               if ((NT_STATUS_V(result) == DCERPC_FAULT_OP_RNG_ERROR)
-                   && contact_domain->can_do_samlogon_ex) {
-                       DEBUG(3, ("Got a DC that can not do NetSamLogonEx, "
-                                 "retrying with NetSamLogon\n"));
-                       contact_domain->can_do_samlogon_ex = False;
-                       retry = True;
-                       continue;
-               }
-                       
+               result = rpccli_netlogon_sam_network_logon(netlogon_pipe,
+                                                          state->mem_ctx,
+                                                          state->request.data.auth_crap.logon_parameters,
+                                                          contact_domain->dcname,
+                                                          name_user,
+                                                          name_domain, 
+                                                                       /* Bug #3248 - found by Stefan Burkei. */
+                                                          workstation, /* We carefully set this above so use it... */
+                                                          state->request.data.auth_crap.chal,
+                                                          lm_resp,
+                                                          nt_resp,
+                                                          &info3);
+
                attempts += 1;
 
                /* We have to try a second time as cm_connect_netlogon