Changeset 745 for trunk/server/source3/winbindd/winbindd_creds.c
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source3/winbindd/winbindd_creds.c
r414 r745 5 5 6 6 Copyright (C) Guenther Deschner 2005 7 7 8 8 This program is free software; you can redistribute it and/or modify 9 9 it under the terms of the GNU General Public License as published by 10 10 the Free Software Foundation; either version 3 of the License, or 11 11 (at your option) any later version. 12 12 13 13 This program is distributed in the hope that it will be useful, 14 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 16 GNU General Public License for more details. 17 17 18 18 You should have received a copy of the GNU General Public License 19 19 along with this program. If not, see <http://www.gnu.org/licenses/>. … … 23 23 #include "winbindd.h" 24 24 #include "../libcli/auth/libcli_auth.h" 25 #include "../libcli/security/security.h" 25 26 #undef DBGC_CLASS 26 27 #define DBGC_CLASS DBGC_WINBIND … … 30 31 NTSTATUS winbindd_get_creds(struct winbindd_domain *domain, 31 32 TALLOC_CTX *mem_ctx, 32 const DOM_SID*sid,33 const struct dom_sid *sid, 33 34 struct netr_SamInfo3 **info3, 34 35 const uint8 *cached_nt_pass[NT_HASH_LEN], … … 55 56 56 57 NTSTATUS winbindd_store_creds(struct winbindd_domain *domain, 57 TALLOC_CTX *mem_ctx,58 58 const char *user, 59 59 const char *pass, 60 struct netr_SamInfo3 *info3, 61 const DOM_SID *user_sid) 60 struct netr_SamInfo3 *info3) 62 61 { 63 62 NTSTATUS status; 64 63 uchar nt_pass[NT_HASH_LEN]; 65 DOM_SIDcred_sid;64 struct dom_sid cred_sid; 66 65 67 66 if (info3 != NULL) { 68 67 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); 73 70 info3->base.user_flags |= NETLOGON_CACHED_ACCOUNT; 74 75 } else if (user_sid != NULL) {76 77 sid_copy(&cred_sid, user_sid);78 71 79 72 } else if (user != NULL) { … … 83 76 enum lsa_SidType type; 84 77 85 if (!lookup_cached_name(mem_ctx, 86 domain->name, 78 if (!lookup_cached_name(domain->name, 87 79 user, 88 80 &cred_sid, … … 121 113 dump_data_pw("nt_pass", nt_pass, NT_HASH_LEN); 122 114 123 status = wcache_save_creds(domain, mem_ctx,&cred_sid, nt_pass);115 status = wcache_save_creds(domain, &cred_sid, nt_pass); 124 116 if (!NT_STATUS_IS_OK(status)) { 125 117 return status; … … 137 129 138 130 NTSTATUS winbindd_update_creds_by_info3(struct winbindd_domain *domain, 139 TALLOC_CTX *mem_ctx,140 131 const char *user, 141 132 const char *pass, 142 133 struct netr_SamInfo3 *info3) 143 134 { 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); 153 136 } 154 137 155 138 NTSTATUS winbindd_update_creds_by_name(struct winbindd_domain *domain, 156 TALLOC_CTX *mem_ctx,157 139 const char *user, 158 140 const char *pass) 159 141 { 160 return winbindd_store_creds(domain, mem_ctx, user, pass, NULL, NULL);142 return winbindd_store_creds(domain, user, pass, NULL); 161 143 } 162 144
Note:
See TracChangeset
for help on using the changeset viewer.