Changeset 989 for vendor/current/source3/winbindd
- Timestamp:
- Nov 25, 2016, 8:04:54 PM (9 years ago)
- Location:
- vendor/current/source3/winbindd
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/winbindd/idmap_rfc2307.c
r988 r989 671 671 672 672 default: 673 DEBUG(10, ("Nothing to do for SID %s, " 674 "previous name lookup failed\n", 675 sid_string_dbg(map->map->sid))); 673 break; 676 674 } 677 675 -
vendor/current/source3/winbindd/idmap_util.c
r988 r989 161 161 bool idmap_unix_id_is_in_range(uint32_t id, struct idmap_domain *dom) 162 162 { 163 if (id == 0) {164 /* 0 is not an allowed unix id for id mapping */165 return false;166 }167 168 163 if ((dom->low_id && (id < dom->low_id)) || 169 164 (dom->high_id && (id > dom->high_id))) -
vendor/current/source3/winbindd/wb_lookupsids.c
r988 r989 73 73 */ 74 74 uint32_t *single_sids; 75 /* Pointer into the "domains" array above*/ 76 struct wb_lookupsids_domain **single_domains; 75 77 uint32_t num_single_sids; 76 78 uint32_t single_sids_done; … … 126 128 state->single_sids = talloc_array(state, uint32_t, num_sids); 127 129 if (tevent_req_nomem(state->single_sids, req)) { 130 return tevent_req_post(req, ev); 131 } 132 state->single_domains = talloc_zero_array(state, 133 struct wb_lookupsids_domain *, 134 num_sids); 135 if (tevent_req_nomem(state->single_domains, req)) { 128 136 return tevent_req_post(req, ev); 129 137 } … … 456 464 state->single_sids[state->num_single_sids] = 457 465 res_sid_index; 466 state->single_domains[state->num_single_sids] = d; 458 467 state->num_single_sids += 1; 459 468 } … … 515 524 TALLOC_FREE(subreq); 516 525 if (!NT_STATUS_IS_OK(status)) { 526 struct wb_lookupsids_domain *wb_domain; 527 const char *tmpname; 528 517 529 type = SID_NAME_UNKNOWN; 518 530 519 domain_name = talloc_strdup(talloc_tos(), ""); 531 wb_domain = state->single_domains[state->single_sids_done]; 532 if (wb_domain != NULL) { 533 /* 534 * If the lookupsid failed because the rid not 535 * found in a domain and we have a reference 536 * to the lookup domain, use the name from 537 * there. 538 * 539 * Callers like sid2xid will use the domain 540 * name in the idmap backend to figure out 541 * which domain to use in processing. 542 */ 543 tmpname = wb_domain->domain->name; 544 } else { 545 tmpname = ""; 546 } 547 domain_name = talloc_strdup(talloc_tos(), tmpname); 520 548 if (tevent_req_nomem(domain_name, req)) { 521 549 return; -
vendor/current/source3/winbindd/winbindd_cache.c
r988 r989 510 510 511 511 /* 512 refresh the domain sequence number. If force is true 513 then always refresh it, no matter how recently we fetched it 512 refresh the domain sequence number on timeout. 514 513 */ 515 514 516 static void refresh_sequence_number(struct winbindd_domain *domain , bool force)515 static void refresh_sequence_number(struct winbindd_domain *domain) 517 516 { 518 517 NTSTATUS status; … … 537 536 538 537 /* see if we have to refetch the domain sequence number */ 539 if ( !force &&(time_diff < cache_time) &&538 if ((time_diff < cache_time) && 540 539 (domain->sequence_number != DOM_SEQUENCE_NONE) && 541 540 NT_STATUS_IS_OK(domain->last_status)) { … … 711 710 } 712 711 713 refresh_sequence_number(domain , false);712 refresh_sequence_number(domain); 714 713 715 714 va_start(ap, format); … … 1559 1558 1560 1559 /* and save it */ 1561 refresh_sequence_number(domain , false);1560 refresh_sequence_number(domain); 1562 1561 if (!NT_STATUS_IS_OK(status)) { 1563 1562 return status; … … 1671 1670 } 1672 1671 /* and save it */ 1673 refresh_sequence_number(domain , false);1672 refresh_sequence_number(domain); 1674 1673 if (!NT_STATUS_IS_OK(status)) { 1675 1674 return status; … … 1776 1775 } 1777 1776 /* and save it */ 1778 refresh_sequence_number(domain , false);1777 refresh_sequence_number(domain); 1779 1778 if (!NT_STATUS_IS_OK(status)) { 1780 1779 return status; … … 1891 1890 } 1892 1891 /* and save it */ 1893 refresh_sequence_number(domain , false);1892 refresh_sequence_number(domain); 1894 1893 1895 1894 if (domain->online && … … 2005 2004 } 2006 2005 /* and save it */ 2007 refresh_sequence_number(domain , false);2006 refresh_sequence_number(domain); 2008 2007 if (!NT_STATUS_IS_OK(status)) { 2009 2008 return status; … … 2230 2229 } 2231 2230 2232 refresh_sequence_number(domain , false);2231 refresh_sequence_number(domain); 2233 2232 2234 2233 for (i=0; i<num_rids; i++) { … … 2391 2390 } 2392 2391 /* and save it */ 2393 refresh_sequence_number(domain , false);2392 refresh_sequence_number(domain); 2394 2393 if (!NT_STATUS_IS_OK(status)) { 2395 2394 return status; … … 2509 2508 2510 2509 /* and save it */ 2511 refresh_sequence_number(domain , false);2510 refresh_sequence_number(domain); 2512 2511 if (!NT_STATUS_IS_OK(status)) { 2513 2512 return status; … … 2662 2661 } 2663 2662 /* and save it */ 2664 refresh_sequence_number(domain , false);2663 refresh_sequence_number(domain); 2665 2664 if (!NT_STATUS_IS_OK(status)) { 2666 2665 return status; … … 2798 2797 } 2799 2798 /* and save it */ 2800 refresh_sequence_number(domain , false);2799 refresh_sequence_number(domain); 2801 2800 if (!NT_STATUS_IS_OK(status)) { 2802 2801 return status; … … 2821 2820 static NTSTATUS sequence_number(struct winbindd_domain *domain, uint32_t *seq) 2822 2821 { 2823 refresh_sequence_number(domain , false);2822 refresh_sequence_number(domain); 2824 2823 2825 2824 *seq = domain->sequence_number; … … 2999 2998 } 3000 2999 /* and save it */ 3001 refresh_sequence_number(domain, false);3000 refresh_sequence_number(domain); 3002 3001 if (!NT_STATUS_IS_OK(status)) { 3003 3002 return status; … … 3071 3070 } 3072 3071 /* and save it */ 3073 refresh_sequence_number(domain , false);3072 refresh_sequence_number(domain); 3074 3073 if (!NT_STATUS_IS_OK(status)) { 3075 3074 return status; … … 3332 3331 } 3333 3332 3333 /* 3334 * Cache a name to sid without checking the sequence number. 3335 * Used when caching from a trusted PAC. 3336 */ 3337 3338 void cache_name2sid_trusted(struct winbindd_domain *domain, 3339 const char *domain_name, 3340 const char *name, 3341 enum lsa_SidType type, 3342 const struct dom_sid *sid) 3343 { 3344 /* 3345 * Ensure we store the mapping with the 3346 * existing sequence number from the cache. 3347 */ 3348 get_cache(domain); 3349 (void)fetch_cache_seqnum(domain, time(NULL)); 3350 wcache_save_name_to_sid(domain, 3351 NT_STATUS_OK, 3352 domain_name, 3353 name, 3354 sid, 3355 type); 3356 } 3357 3334 3358 void cache_name2sid(struct winbindd_domain *domain, 3335 3359 const char *domain_name, const char *name, 3336 3360 enum lsa_SidType type, const struct dom_sid *sid) 3337 3361 { 3338 refresh_sequence_number(domain , false);3362 refresh_sequence_number(domain); 3339 3363 wcache_save_name_to_sid(domain, NT_STATUS_OK, domain_name, name, 3340 3364 sid, type); … … 3472 3496 NTSTATUS status; 3473 3497 int ret; 3474 struct cred_list *cred, * oldest = NULL;3498 struct cred_list *cred, *next, *oldest = NULL; 3475 3499 3476 3500 if (!cache->tdb) { … … 3541 3565 } 3542 3566 done: 3543 SAFE_FREE(wcache_cred_list); 3567 for (cred = wcache_cred_list; cred; cred = next) { 3568 next = cred->next; 3569 DLIST_REMOVE(wcache_cred_list, cred); 3570 SAFE_FREE(cred); 3571 } 3544 3572 SAFE_FREE(oldest); 3545 3573 -
vendor/current/source3/winbindd/winbindd_dual.c
r988 r989 836 836 DEBUG(10,("winbind_msg_dump_event_list received\n")); 837 837 838 dump_event_list(winbind_event_context());838 DBG_WARNING("dump event list no longer implemented\n"); 839 839 840 840 for (child = winbindd_children; child != NULL; child = child->next) { … … 1241 1241 { 1242 1242 DEBUG(5,("child_msg_dump_event_list received\n")); 1243 1244 dump_event_list(winbind_event_context()); 1243 DBG_WARNING("dump_event_list no longer implemented\n"); 1245 1244 } 1246 1245 -
vendor/current/source3/winbindd/winbindd_dual_srv.c
r988 r989 203 203 for (j=0; j<num_ids; j++) { 204 204 struct wbint_TransID *id = &r->in.ids->ids[id_idx[j]]; 205 206 if (!idmap_unix_id_is_in_range(ids[j].xid.id, dom)) { 207 ids[j].status = ID_UNMAPPED; 208 } 205 209 206 210 if (ids[j].status != ID_MAPPED) { -
vendor/current/source3/winbindd/winbindd_pam.c
r988 r989 2560 2560 2561 2561 if (logon_info) { 2562 /* Signature verification succeeded, trust the PAC */ 2562 /* 2563 * Signature verification succeeded, we can 2564 * trust the PAC and prime the netsamlogon 2565 * and name2sid caches. DO NOT DO THIS 2566 * in the signature verification failed 2567 * code path. 2568 */ 2569 struct winbindd_domain *domain = NULL; 2570 2563 2571 result = create_info3_from_pac_logon_info(state->mem_ctx, 2564 2572 logon_info, … … 2568 2576 } 2569 2577 netsamlogon_cache_store(NULL, info3_copy); 2578 2579 /* 2580 * We're in the parent here, so find the child 2581 * pointer from the PAC domain name. 2582 */ 2583 domain = find_domain_from_name_noinit( 2584 info3_copy->base.logon_domain.string); 2585 if (domain && domain->primary ) { 2586 struct dom_sid user_sid; 2587 2588 sid_compose(&user_sid, 2589 info3_copy->base.domain_sid, 2590 info3_copy->base.rid); 2591 2592 cache_name2sid_trusted(domain, 2593 info3_copy->base.logon_domain.string, 2594 info3_copy->base.account_name.string, 2595 SID_NAME_USER, 2596 &user_sid); 2597 2598 DBG_INFO("PAC for user %s\%s SID %s primed cache\n", 2599 info3_copy->base.logon_domain.string, 2600 info3_copy->base.account_name.string, 2601 sid_string_dbg(&user_sid)); 2602 } 2570 2603 2571 2604 } else { -
vendor/current/source3/winbindd/winbindd_proto.h
r988 r989 87 87 struct dom_sid *sid, 88 88 enum lsa_SidType *type); 89 void cache_name2sid_trusted(struct winbindd_domain *domain, 90 const char *domain_name, 91 const char *name, 92 enum lsa_SidType type, 93 const struct dom_sid *sid); 89 94 void cache_name2sid(struct winbindd_domain *domain, 90 95 const char *domain_name, const char *name, -
vendor/current/source3/winbindd/winbindd_util.c
r988 r989 1103 1103 if ( !p ) { 1104 1104 fstrcpy(user, domuser); 1105 1106 if ( assume_domain(lp_workgroup())) { 1105 p = strchr(domuser, '@'); 1106 1107 if ( assume_domain(lp_workgroup()) && p == NULL) { 1107 1108 fstrcpy(domain, lp_workgroup()); 1108 } else if ( (p = strchr(domuser, '@'))!= NULL) {1109 } else if (p != NULL) { 1109 1110 fstrcpy(domain, p + 1); 1110 1111 user[PTR_DIFF(p, domuser)] = 0;
Note:
See TracChangeset
for help on using the changeset viewer.