Changeset 745 for trunk/server/source3/winbindd/idmap_hash
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 3 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/idmap_hash/idmap_hash.c
r414 r745 21 21 #include "includes.h" 22 22 #include "winbindd/winbindd.h" 23 #include "idmap.h" 23 24 #include "idmap_hash.h" 25 #include "ads.h" 26 #include "nss_info.h" 27 #include "../libcli/security/dom_sid.h" 24 28 25 29 #undef DBGC_CLASS … … 27 31 28 32 struct sid_hash_table { 29 DOM_SID*sid;33 struct dom_sid *sid; 30 34 }; 31 35 32 struct sid_hash_table *hashed_domains = NULL;33 34 36 /********************************************************************* 35 37 Hash a domain SID (S-1-5-12-aaa-bbb-ccc) to a 12bit number 36 38 ********************************************************************/ 37 39 38 static uint32_t hash_domain_sid(const DOM_SID*sid)40 static uint32_t hash_domain_sid(const struct dom_sid *sid) 39 41 { 40 42 uint32_t hash; … … 103 105 ********************************************************************/ 104 106 105 static NTSTATUS be_init(struct idmap_domain *dom ,106 const char *params) 107 { 107 static NTSTATUS be_init(struct idmap_domain *dom) 108 { 109 struct sid_hash_table *hashed_domains; 108 110 NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; 109 111 struct winbindd_tdc_domain *dom_list = NULL; … … 111 113 int i; 112 114 113 /* If the domain SID hash ta lbe has been initialized, assume115 /* If the domain SID hash table has been initialized, assume 114 116 that we completed this function previously */ 115 117 116 if ( hashed_domains) {118 if (dom->private_data != NULL) { 117 119 nt_status = NT_STATUS_OK; 118 120 goto done; … … 126 128 /* Create the hash table of domain SIDs */ 127 129 128 hashed_domains = TALLOC_ZERO_ARRAY( NULL, struct sid_hash_table, 4096);130 hashed_domains = TALLOC_ZERO_ARRAY(dom, struct sid_hash_table, 4096); 129 131 BAIL_ON_PTR_NT_ERROR(hashed_domains, nt_status); 130 132 … … 144 146 hash)); 145 147 146 hashed_domains[hash].sid = talloc(hashed_domains, DOM_SID);148 hashed_domains[hash].sid = talloc(hashed_domains, struct dom_sid); 147 149 sid_copy(hashed_domains[hash].sid, &dom_list[i].sid); 148 150 } 151 152 dom->private_data = hashed_domains; 149 153 150 154 done: … … 158 162 struct id_map **ids) 159 163 { 164 struct sid_hash_table *hashed_domains = talloc_get_type_abort( 165 dom->private_data, struct sid_hash_table); 160 166 NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; 161 167 int i; … … 165 171 ids[i]->status = ID_UNKNOWN; 166 172 } 167 168 nt_status = be_init(dom , NULL);173 174 nt_status = be_init(dom); 169 175 BAIL_ON_NTSTATUS_ERROR(nt_status); 170 176 … … 194 200 continue; 195 201 196 sid_copy(ids[i]->sid, hashed_domains[h_domain].sid); 197 sid_append_rid(ids[i]->sid, h_rid); 202 sid_compose(ids[i]->sid, hashed_domains[h_domain].sid, h_rid); 198 203 ids[i]->status = ID_MAPPED; 199 204 } … … 216 221 ids[i]->status = ID_UNKNOWN; 217 222 } 218 219 nt_status = be_init(dom , NULL);223 224 nt_status = be_init(dom); 220 225 BAIL_ON_NTSTATUS_ERROR(nt_status); 221 226 … … 226 231 227 232 for (i=0; ids[i]; i++) { 228 DOM_SIDsid;233 struct dom_sid sid; 229 234 uint32_t rid; 230 235 uint32_t h_domain, h_rid; … … 253 258 ********************************************************************/ 254 259 255 static NTSTATUS be_close(struct idmap_domain *dom)256 {257 if (hashed_domains)258 talloc_free(hashed_domains);259 260 return NT_STATUS_OK;261 }262 263 /*********************************************************************264 ********************************************************************/265 266 260 static NTSTATUS nss_hash_init(struct nss_domain_entry *e ) 267 261 { 268 return be_init(NULL , NULL);262 return be_init(NULL); 269 263 } 270 264 … … 273 267 274 268 static NTSTATUS nss_hash_get_info(struct nss_domain_entry *e, 275 const DOM_SID*sid,269 const struct dom_sid *sid, 276 270 TALLOC_CTX *ctx, 277 ADS_STRUCT *ads,278 LDAPMessage *msg,279 271 const char **homedir, 280 272 const char **shell, … … 359 351 .unixids_to_sids = unixids_to_sids, 360 352 .sids_to_unixids = sids_to_unixids, 361 .close_fn = be_close362 353 }; 363 354 -
trunk/server/source3/winbindd/idmap_hash/mapfile.c
r414 r745 20 20 21 21 #include "includes.h" 22 #include "system/filesys.h" 22 23 #include "winbindd/winbindd.h" 24 #include "idmap.h" 23 25 #include "idmap_hash.h" 24 26 #include <stdio.h>
Note:
See TracChangeset
for help on using the changeset viewer.