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

    r414 r745  
    44   Copyright (C) Andrew Bartlett         2001-2002
    55   Copyright (C) Jelmer Vernooij              2002
    6    
     6
    77   This program is free software; you can redistribute it and/or modify
    88   it under the terms of the GNU General Public License as published by
    99   the Free Software Foundation; either version 3 of the License, or
    1010   (at your option) any later version.
    11    
     11
    1212   This program is distributed in the hope that it will be useful,
    1313   but WITHOUT ANY WARRANTY; without even the implied warranty of
    1414   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1515   GNU General Public License for more details.
    16    
     16
    1717   You should have received a copy of the GNU General Public License
    1818   along with this program.  If not, see <http://www.gnu.org/licenses/>.
     
    2020
    2121#include "includes.h"
     22#include "auth.h"
    2223
    2324#undef DBGC_CLASS
     
    3536                                     void *my_private_data,
    3637                                     TALLOC_CTX *mem_ctx,
    37                                      const auth_usersupplied_info *user_info,
    38                                      auth_serversupplied_info **server_info)
     38                                     const struct auth_usersupplied_info *user_info,
     39                                     struct auth_serversupplied_info **server_info)
    3940{
    4041        /* mark this as 'not for me' */
    4142        NTSTATUS nt_status = NT_STATUS_NOT_IMPLEMENTED;
    4243
    43         if (!(user_info->internal_username
    44               && *user_info->internal_username)) {
     44        DEBUG(10, ("Check auth for: [%s]\n", user_info->mapped.account_name));
     45
     46        if (!(user_info->mapped.account_name
     47              && *user_info->mapped.account_name)) {
    4548                nt_status = make_server_info_guest(NULL, server_info);
    4649        }
     
    5356static NTSTATUS auth_init_guest(struct auth_context *auth_context, const char *options, auth_methods **auth_method)
    5457{
    55         if (!make_auth_methods(auth_context, auth_method))
     58        struct auth_methods *result;
     59
     60        result = TALLOC_ZERO_P(auth_context, struct auth_methods);
     61        if (result == NULL) {
    5662                return NT_STATUS_NO_MEMORY;
     63        }
     64        result->auth = check_guest_security;
     65        result->name = "guest";
    5766
    58         (*auth_method)->auth = check_guest_security;
    59         (*auth_method)->name = "guest";
     67        *auth_method = result;
    6068        return NT_STATUS_OK;
    6169}
     
    7886                                                void *my_private_data,
    7987                                                TALLOC_CTX *mem_ctx,
    80                                                 const auth_usersupplied_info *user_info,
    81                                                 auth_serversupplied_info **server_info)
     88                                                const struct auth_usersupplied_info *user_info,
     89                                                struct auth_serversupplied_info **server_info)
    8290{
    8391        NTSTATUS nt_status;
    8492        fstring user;
    8593        long error_num;
    86         fstrcpy(user, user_info->smb_name);
    87        
     94
     95        DEBUG(10, ("Check auth for: [%s]\n", user_info->mapped.account_name));
     96
     97        fstrcpy(user, user_info->client.account_name);
     98
    8899        if (strnequal("NT_STATUS", user, strlen("NT_STATUS"))) {
    89100                strupper_m(user);
     
    93104        strlower_m(user);
    94105        error_num = strtoul(user, NULL, 16);
    95        
     106
    96107        DEBUG(5,("check_name_to_ntstatus_security: Error for user %s was %lx\n", user, error_num));
    97108
    98109        nt_status = NT_STATUS(error_num);
    99        
     110
    100111        return nt_status;
    101112}
     
    105116static NTSTATUS auth_init_name_to_ntstatus(struct auth_context *auth_context, const char *param, auth_methods **auth_method)
    106117{
    107         if (!make_auth_methods(auth_context, auth_method))
     118        struct auth_methods *result;
     119
     120        result = TALLOC_ZERO_P(auth_context, struct auth_methods);
     121        if (result == NULL) {
    108122                return NT_STATUS_NO_MEMORY;
     123        }
     124        result->auth = check_name_to_ntstatus_security;
     125        result->name = "name_to_ntstatus";
    109126
    110         (*auth_method)->auth = check_name_to_ntstatus_security;
    111         (*auth_method)->name = "name_to_ntstatus";
     127        *auth_method = result;
    112128        return NT_STATUS_OK;
    113129}
     
    131147                                               void *my_private_data,
    132148                                               TALLOC_CTX *mem_ctx,
    133                                                const auth_usersupplied_info *user_info,
    134                                                auth_serversupplied_info **server_info)
     149                                               const struct auth_usersupplied_info *user_info,
     150                                               struct auth_serversupplied_info **server_info)
    135151{
    136152        return NT_STATUS_NOT_IMPLEMENTED;
     
    150166
    151167
    152 /** Module initailisation function */
     168/** Module initialisation function */
    153169
    154170static NTSTATUS auth_init_fixed_challenge(struct auth_context *auth_context, const char *param, auth_methods **auth_method)
    155171{
    156         if (!make_auth_methods(auth_context, auth_method))
     172        struct auth_methods *result;
     173
     174        result = TALLOC_ZERO_P(auth_context, struct auth_methods);
     175        if (result == NULL) {
    157176                return NT_STATUS_NO_MEMORY;
     177        }
     178        result->auth = check_fixed_challenge_security;
     179        result->get_chal = auth_get_fixed_challenge;
     180        result->name = "fixed_challenge";
    158181
    159         (*auth_method)->auth = check_fixed_challenge_security;
    160         (*auth_method)->get_chal = auth_get_fixed_challenge;
    161         (*auth_method)->name = "fixed_challenge";
     182        *auth_method = result;
    162183        return NT_STATUS_OK;
    163184}
Note: See TracChangeset for help on using the changeset viewer.