Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/auth/auth_compat.c

    r414 r745  
    1919
    2020#include "includes.h"
     21#include "auth.h"
    2122
    2223extern struct auth_context *negprot_global_auth_context;
     
    3132
    3233/****************************************************************************
    33 check if a username/password is OK assuming the password is a 24 byte
    34 SMB hash
     34check if a username/password is OK assuming the password is in plaintext
    3535return True if the password is correct, False otherwise
    3636****************************************************************************/
    3737
    38 NTSTATUS check_plaintext_password(const char *smb_name, DATA_BLOB plaintext_password, auth_serversupplied_info **server_info)
     38NTSTATUS check_plaintext_password(const char *smb_name,
     39                                  DATA_BLOB plaintext_blob,
     40                                  struct auth_serversupplied_info **server_info)
    3941{
    4042        struct auth_context *plaintext_auth_context = NULL;
    41         auth_usersupplied_info *user_info = NULL;
     43        struct auth_usersupplied_info *user_info = NULL;
    4244        uint8_t chal[8];
    4345        NTSTATUS nt_status;
    44         if (!NT_STATUS_IS_OK(nt_status = make_auth_context_subsystem(&plaintext_auth_context))) {
     46
     47        nt_status = make_auth_context_subsystem(talloc_tos(),
     48                                                &plaintext_auth_context);
     49        if (!NT_STATUS_IS_OK(nt_status)) {
    4550                return nt_status;
    4651        }
     
    5156        if (!make_user_info_for_reply(&user_info,
    5257                                      smb_name, lp_workgroup(), chal,
    53                                       plaintext_password)) {
     58                                      plaintext_blob)) {
    5459                return NT_STATUS_NO_MEMORY;
    5560        }
     
    5863                                                                user_info, server_info);
    5964
    60         (plaintext_auth_context->free)(&plaintext_auth_context);
     65        TALLOC_FREE(plaintext_auth_context);
    6166        free_user_info(&user_info);
    6267        return nt_status;
     
    6772                               const char *domain,
    6873                               DATA_BLOB lm_pwd,
    69                                DATA_BLOB nt_pwd,
    70                                DATA_BLOB plaintext_password,
    71                                bool encrypted)
     74                               DATA_BLOB nt_pwd)
    7275
    7376{
    7477        NTSTATUS nt_status;
    75         auth_serversupplied_info *server_info = NULL;
    76         if (encrypted) {
    77                 auth_usersupplied_info *user_info = NULL;
    78                 if (actx == NULL) {
    79                         return NT_STATUS_INTERNAL_ERROR;
    80                 }
    81                 make_user_info_for_reply_enc(&user_info, smb_name,
    82                                              domain,
    83                                              lm_pwd,
    84                                              nt_pwd);
    85                 nt_status = actx->check_ntlm_password(actx, user_info, &server_info);
    86                 free_user_info(&user_info);
    87         } else {
    88                 nt_status = check_plaintext_password(smb_name, plaintext_password, &server_info);
    89         }               
     78        struct auth_serversupplied_info *server_info = NULL;
     79        struct auth_usersupplied_info *user_info = NULL;
     80        if (actx == NULL) {
     81                return NT_STATUS_INTERNAL_ERROR;
     82        }
     83        make_user_info_for_reply_enc(&user_info, smb_name,
     84                                     domain,
     85                                     lm_pwd,
     86                                     nt_pwd);
     87        nt_status = actx->check_ntlm_password(actx, user_info, &server_info);
     88        free_user_info(&user_info);
    9089        TALLOC_FREE(server_info);
    9190        return nt_status;
     
    112111                 */
    113112                if (session_workgroup) {
    114                         if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, session_workgroup, null_password, password_blob, null_password, encrypted))) {
     113                        if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, session_workgroup, null_password, password_blob))) {
    115114                                return True;
    116115                        }
    117                         if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, session_workgroup, password_blob, null_password, null_password, encrypted))) {
     116                        if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, session_workgroup, password_blob, null_password))) {
    118117                                return True;
    119118                        }
    120119                }
    121120
    122                 if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, lp_workgroup(), null_password, password_blob, null_password, encrypted))) {
     121                if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, lp_workgroup(), null_password, password_blob))) {
    123122                        return True;
    124123                }
    125124
    126                 if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, lp_workgroup(), password_blob, null_password, null_password, encrypted))) {
     125                if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, lp_workgroup(), password_blob, null_password))) {
    127126                        return True;
    128127                }
    129128        } else {
    130                 if (NT_STATUS_IS_OK(pass_check_smb(actx, smb_name, lp_workgroup(), null_password, null_password, password_blob, encrypted))) {
     129                struct auth_serversupplied_info *server_info = NULL;
     130                NTSTATUS nt_status = check_plaintext_password(smb_name, password_blob, &server_info);
     131                TALLOC_FREE(server_info);
     132                if (NT_STATUS_IS_OK(nt_status)) {
    131133                        return True;
    132134                }
Note: See TracChangeset for help on using the changeset viewer.