Ignore:
Timestamp:
Nov 25, 2016, 8:04:54 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.7

Location:
vendor/current/source3/winbindd
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/winbindd/idmap_rfc2307.c

    r988 r989  
    671671
    672672                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;
    676674                }
    677675
  • vendor/current/source3/winbindd/idmap_util.c

    r988 r989  
    161161bool idmap_unix_id_is_in_range(uint32_t id, struct idmap_domain *dom)
    162162{
    163         if (id == 0) {
    164                 /* 0 is not an allowed unix id for id mapping */
    165                 return false;
    166         }
    167 
    168163        if ((dom->low_id && (id < dom->low_id)) ||
    169164            (dom->high_id && (id > dom->high_id)))
  • vendor/current/source3/winbindd/wb_lookupsids.c

    r988 r989  
    7373         */
    7474        uint32_t *single_sids;
     75        /* Pointer into the "domains" array above*/
     76        struct wb_lookupsids_domain **single_domains;
    7577        uint32_t num_single_sids;
    7678        uint32_t single_sids_done;
     
    126128        state->single_sids = talloc_array(state, uint32_t, num_sids);
    127129        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)) {
    128136                return tevent_req_post(req, ev);
    129137        }
     
    456464                        state->single_sids[state->num_single_sids] =
    457465                                res_sid_index;
     466                        state->single_domains[state->num_single_sids] = d;
    458467                        state->num_single_sids += 1;
    459468                }
     
    515524        TALLOC_FREE(subreq);
    516525        if (!NT_STATUS_IS_OK(status)) {
     526                struct wb_lookupsids_domain *wb_domain;
     527                const char *tmpname;
     528
    517529                type = SID_NAME_UNKNOWN;
    518530
    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);
    520548                if (tevent_req_nomem(domain_name, req)) {
    521549                        return;
  • vendor/current/source3/winbindd/winbindd_cache.c

    r988 r989  
    510510
    511511/*
    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.
    514513*/
    515514
    516 static void refresh_sequence_number(struct winbindd_domain *domain, bool force)
     515static void refresh_sequence_number(struct winbindd_domain *domain)
    517516{
    518517        NTSTATUS status;
     
    537536
    538537        /* see if we have to refetch the domain sequence number */
    539         if (!force && (time_diff < cache_time) &&
     538        if ((time_diff < cache_time) &&
    540539                        (domain->sequence_number != DOM_SEQUENCE_NONE) &&
    541540                        NT_STATUS_IS_OK(domain->last_status)) {
     
    711710        }
    712711
    713         refresh_sequence_number(domain, false);
     712        refresh_sequence_number(domain);
    714713
    715714        va_start(ap, format);
     
    15591558
    15601559        /* and save it */
    1561         refresh_sequence_number(domain, false);
     1560        refresh_sequence_number(domain);
    15621561        if (!NT_STATUS_IS_OK(status)) {
    15631562                return status;
     
    16711670        }
    16721671        /* and save it */
    1673         refresh_sequence_number(domain, false);
     1672        refresh_sequence_number(domain);
    16741673        if (!NT_STATUS_IS_OK(status)) {
    16751674                return status;
     
    17761775        }
    17771776        /* and save it */
    1778         refresh_sequence_number(domain, false);
     1777        refresh_sequence_number(domain);
    17791778        if (!NT_STATUS_IS_OK(status)) {
    17801779                return status;
     
    18911890        }
    18921891        /* and save it */
    1893         refresh_sequence_number(domain, false);
     1892        refresh_sequence_number(domain);
    18941893
    18951894        if (domain->online &&
     
    20052004        }
    20062005        /* and save it */
    2007         refresh_sequence_number(domain, false);
     2006        refresh_sequence_number(domain);
    20082007        if (!NT_STATUS_IS_OK(status)) {
    20092008                return status;
     
    22302229        }
    22312230
    2232         refresh_sequence_number(domain, false);
     2231        refresh_sequence_number(domain);
    22332232
    22342233        for (i=0; i<num_rids; i++) {
     
    23912390        }
    23922391        /* and save it */
    2393         refresh_sequence_number(domain, false);
     2392        refresh_sequence_number(domain);
    23942393        if (!NT_STATUS_IS_OK(status)) {
    23952394                return status;
     
    25092508
    25102509        /* and save it */
    2511         refresh_sequence_number(domain, false);
     2510        refresh_sequence_number(domain);
    25122511        if (!NT_STATUS_IS_OK(status)) {
    25132512                return status;
     
    26622661        }
    26632662        /* and save it */
    2664         refresh_sequence_number(domain, false);
     2663        refresh_sequence_number(domain);
    26652664        if (!NT_STATUS_IS_OK(status)) {
    26662665                return status;
     
    27982797        }
    27992798        /* and save it */
    2800         refresh_sequence_number(domain, false);
     2799        refresh_sequence_number(domain);
    28012800        if (!NT_STATUS_IS_OK(status)) {
    28022801                return status;
     
    28212820static NTSTATUS sequence_number(struct winbindd_domain *domain, uint32_t *seq)
    28222821{
    2823         refresh_sequence_number(domain, false);
     2822        refresh_sequence_number(domain);
    28242823
    28252824        *seq = domain->sequence_number;
     
    29992998        }
    30002999        /* and save it */
    3001         refresh_sequence_number(domain, false);
     3000        refresh_sequence_number(domain);
    30023001        if (!NT_STATUS_IS_OK(status)) {
    30033002                return status;
     
    30713070        }
    30723071        /* and save it */
    3073         refresh_sequence_number(domain, false);
     3072        refresh_sequence_number(domain);
    30743073        if (!NT_STATUS_IS_OK(status)) {
    30753074                return status;
     
    33323331}
    33333332
     3333/*
     3334 * Cache a name to sid without checking the sequence number.
     3335 * Used when caching from a trusted PAC.
     3336 */
     3337
     3338void 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
    33343358void cache_name2sid(struct winbindd_domain *domain,
    33353359                    const char *domain_name, const char *name,
    33363360                    enum lsa_SidType type, const struct dom_sid *sid)
    33373361{
    3338         refresh_sequence_number(domain, false);
     3362        refresh_sequence_number(domain);
    33393363        wcache_save_name_to_sid(domain, NT_STATUS_OK, domain_name, name,
    33403364                                sid, type);
     
    34723496        NTSTATUS status;
    34733497        int ret;
    3474         struct cred_list *cred, *oldest = NULL;
     3498        struct cred_list *cred, *next, *oldest = NULL;
    34753499
    34763500        if (!cache->tdb) {
     
    35413565        }
    35423566done:
    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        }
    35443572        SAFE_FREE(oldest);
    35453573
  • vendor/current/source3/winbindd/winbindd_dual.c

    r988 r989  
    836836        DEBUG(10,("winbind_msg_dump_event_list received\n"));
    837837
    838         dump_event_list(winbind_event_context());
     838        DBG_WARNING("dump event list no longer implemented\n");
    839839
    840840        for (child = winbindd_children; child != NULL; child = child->next) {
     
    12411241{
    12421242        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");
    12451244}
    12461245
  • vendor/current/source3/winbindd/winbindd_dual_srv.c

    r988 r989  
    203203                for (j=0; j<num_ids; j++) {
    204204                        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                        }
    205209
    206210                        if (ids[j].status != ID_MAPPED) {
  • vendor/current/source3/winbindd/winbindd_pam.c

    r988 r989  
    25602560
    25612561        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
    25632571                result = create_info3_from_pac_logon_info(state->mem_ctx,
    25642572                                                        logon_info,
     
    25682576                }
    25692577                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                }
    25702603
    25712604        } else {
  • vendor/current/source3/winbindd/winbindd_proto.h

    r988 r989  
    8787                        struct dom_sid *sid,
    8888                        enum lsa_SidType *type);
     89void 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);
    8994void cache_name2sid(struct winbindd_domain *domain,
    9095                    const char *domain_name, const char *name,
  • vendor/current/source3/winbindd/winbindd_util.c

    r988 r989  
    11031103        if ( !p ) {
    11041104                fstrcpy(user, domuser);
    1105 
    1106                 if ( assume_domain(lp_workgroup())) {
     1105                p = strchr(domuser, '@');
     1106
     1107                if ( assume_domain(lp_workgroup()) && p == NULL) {
    11071108                        fstrcpy(domain, lp_workgroup());
    1108                 } else if ((p = strchr(domuser, '@')) != NULL) {
     1109                } else if (p != NULL) {
    11091110                        fstrcpy(domain, p + 1);
    11101111                        user[PTR_DIFF(p, domuser)] = 0;
Note: See TracChangeset for help on using the changeset viewer.