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_script.c

    r414 r745  
    55
    66   Copyright (C) Jeremy Allison 2005.
    7    
     7
    88   This program is free software; you can redistribute it and/or modify
    99   it under the terms of the GNU General Public License as published by
    1010   the Free Software Foundation; either version 3 of the License, or
    1111   (at your option) any later version.
    12    
     12
    1313   This program is distributed in the hope that it will be useful,
    1414   but WITHOUT ANY WARRANTY; without even the implied warranty of
    1515   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1616   GNU General Public License for more details.
    17    
     17
    1818   You should have received a copy of the GNU General Public License
    1919   along with this program.  If not, see <http://www.gnu.org/licenses/>.
     
    2121
    2222#include "includes.h"
     23#include "auth.h"
    2324
    2425#undef malloc
     
    4142                                        void *my_private_data,
    4243                                        TALLOC_CTX *mem_ctx,
    43                                         const auth_usersupplied_info *user_info,
    44                                         auth_serversupplied_info **server_info)
     44                                        const struct auth_usersupplied_info *user_info,
     45                                        struct auth_serversupplied_info **server_info)
    4546{
    4647        const char *script = lp_parm_const_string( GLOBAL_SECTION_SNUM, "auth_script", "script", NULL);
     
    6364        }               
    6465
    65         secret_str_len = strlen(user_info->domain) + 1 +
    66                         strlen(user_info->smb_name) + 1 +
     66        secret_str_len = strlen(user_info->mapped.domain_name) + 1 +
     67                        strlen(user_info->client.account_name) + 1 +
    6768                        16 + 1 + /* 8 bytes of challenge going to 16 */
    6869                        48 + 1 + /* 24 bytes of challenge going to 48 */
     
    7475        }
    7576
    76         safe_strcpy( secret_str, user_info->domain, secret_str_len - 1);
     77        safe_strcpy( secret_str, user_info->mapped.domain_name, secret_str_len - 1);
    7778        safe_strcat( secret_str, "\n", secret_str_len - 1);
    78         safe_strcat( secret_str, user_info->smb_name, secret_str_len - 1);
     79        safe_strcat( secret_str, user_info->client.account_name, secret_str_len - 1);
    7980        safe_strcat( secret_str, "\n", secret_str_len - 1);
    8081
     
    8586        safe_strcat( secret_str, "\n", secret_str_len - 1);
    8687
    87         if (user_info->lm_resp.data) {
     88        if (user_info->password.response.lanman.data) {
    8889                for (i = 0; i < 24; i++) {
    89                         slprintf(&hex_str[i*2], 3, "%02X", user_info->lm_resp.data[i]);
     90                        slprintf(&hex_str[i*2], 3, "%02X", user_info->password.response.lanman.data[i]);
    9091                }
    9192                safe_strcat( secret_str, hex_str, secret_str_len - 1);
     
    9394        safe_strcat( secret_str, "\n", secret_str_len - 1);
    9495
    95         if (user_info->nt_resp.data) {
     96        if (user_info->password.response.nt.data) {
    9697                for (i = 0; i < 24; i++) {
    97                         slprintf(&hex_str[i*2], 3, "%02X", user_info->nt_resp.data[i]);
     98                        slprintf(&hex_str[i*2], 3, "%02X", user_info->password.response.nt.data[i]);
    9899                }
    99100                safe_strcat( secret_str, hex_str, secret_str_len - 1);
     
    110111        if (ret) {
    111112                DEBUG(1,("script_check_user_credentials: failed to authenticate %s\\%s\n",
    112                         user_info->domain, user_info->smb_name ));
     113                        user_info->mapped.domain_name, user_info->client.account_name ));
    113114                /* auth failed. */
    114115                return NT_STATUS_NO_SUCH_USER;
     
    122123static NTSTATUS auth_init_script(struct auth_context *auth_context, const char *param, auth_methods **auth_method)
    123124{
    124         if (!make_auth_methods(auth_context, auth_method)) {
     125        struct auth_methods *result;
     126
     127        result = TALLOC_ZERO_P(auth_context, struct auth_methods);
     128        if (result == NULL) {
    125129                return NT_STATUS_NO_MEMORY;
    126130        }
    127 
    128         (*auth_method)->name = "script";
    129         (*auth_method)->auth = script_check_user_credentials;
     131        result->name = "script";
     132        result->auth = script_check_user_credentials;
    130133
    131134        if (param && *param) {
     
    136139                        return NT_STATUS_UNSUCCESSFUL;
    137140                }
    138                 (*auth_method)->private_data = (void *)priv;
     141                result->private_data = (void *)priv;
    139142        }
     143
     144        *auth_method = result;
    140145        return NT_STATUS_OK;
    141146}
Note: See TracChangeset for help on using the changeset viewer.