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/winbindd/winbindd_creds.c

    r414 r745  
    55
    66   Copyright (C) Guenther Deschner 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/>.
     
    2323#include "winbindd.h"
    2424#include "../libcli/auth/libcli_auth.h"
     25#include "../libcli/security/security.h"
    2526#undef DBGC_CLASS
    2627#define DBGC_CLASS DBGC_WINBIND
     
    3031NTSTATUS winbindd_get_creds(struct winbindd_domain *domain,
    3132                            TALLOC_CTX *mem_ctx,
    32                             const DOM_SID *sid,
     33                            const struct dom_sid *sid,
    3334                            struct netr_SamInfo3 **info3,
    3435                            const uint8 *cached_nt_pass[NT_HASH_LEN],
     
    5556
    5657NTSTATUS winbindd_store_creds(struct winbindd_domain *domain,
    57                               TALLOC_CTX *mem_ctx,
    5858                              const char *user,
    5959                              const char *pass,
    60                               struct netr_SamInfo3 *info3,
    61                               const DOM_SID *user_sid)
     60                              struct netr_SamInfo3 *info3)
    6261{
    6362        NTSTATUS status;
    6463        uchar nt_pass[NT_HASH_LEN];
    65         DOM_SID cred_sid;
     64        struct dom_sid cred_sid;
    6665
    6766        if (info3 != NULL) {
    6867
    69                 DOM_SID sid;
    70                 sid_copy(&sid, info3->base.domain_sid);
    71                 sid_append_rid(&sid, info3->base.rid);
    72                 sid_copy(&cred_sid, &sid);
     68                sid_compose(&cred_sid, info3->base.domain_sid,
     69                            info3->base.rid);
    7370                info3->base.user_flags |= NETLOGON_CACHED_ACCOUNT;
    74 
    75         } else if (user_sid != NULL) {
    76 
    77                 sid_copy(&cred_sid, user_sid);
    7871
    7972        } else if (user != NULL) {
     
    8376                enum lsa_SidType type;
    8477
    85                 if (!lookup_cached_name(mem_ctx,
    86                                         domain->name,
     78                if (!lookup_cached_name(domain->name,
    8779                                        user,
    8880                                        &cred_sid,
     
    121113                dump_data_pw("nt_pass", nt_pass, NT_HASH_LEN);
    122114
    123                 status = wcache_save_creds(domain, mem_ctx, &cred_sid, nt_pass);
     115                status = wcache_save_creds(domain, &cred_sid, nt_pass);
    124116                if (!NT_STATUS_IS_OK(status)) {
    125117                        return status;
     
    137129
    138130NTSTATUS winbindd_update_creds_by_info3(struct winbindd_domain *domain,
    139                                         TALLOC_CTX *mem_ctx,
    140131                                        const char *user,
    141132                                        const char *pass,
    142133                                        struct netr_SamInfo3 *info3)
    143134{
    144         return winbindd_store_creds(domain, mem_ctx, user, pass, info3, NULL);
    145 }
    146 
    147 NTSTATUS winbindd_update_creds_by_sid(struct winbindd_domain *domain,
    148                                       TALLOC_CTX *mem_ctx,
    149                                       const DOM_SID *sid,
    150                                       const char *pass)
    151 {
    152         return winbindd_store_creds(domain, mem_ctx, NULL, pass, NULL, sid);
     135        return winbindd_store_creds(domain, user, pass, info3);
    153136}
    154137
    155138NTSTATUS winbindd_update_creds_by_name(struct winbindd_domain *domain,
    156                                        TALLOC_CTX *mem_ctx,
    157139                                       const char *user,
    158140                                       const char *pass)
    159141{
    160         return winbindd_store_creds(domain, mem_ctx, user, pass, NULL, NULL);
     142        return winbindd_store_creds(domain, user, pass, NULL);
    161143}
    162144
Note: See TracChangeset for help on using the changeset viewer.