Ignore:
Timestamp:
Jul 1, 2011, 4:02:23 PM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Samba 3.5: Update vendor to version 3.5.8

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

Legend:

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

    r414 r594  
    429429static struct idmap_domain *idmap_init_passdb_domain(TALLOC_CTX *mem_ctx)
    430430{
     431        /*
     432         * Always init the default domain, we can't go without one
     433         */
     434        if (default_idmap_domain == NULL) {
     435                default_idmap_domain = idmap_init_default_domain(NULL);
     436        }
     437        if (default_idmap_domain == NULL) {
     438                return NULL;
     439        }
     440
    431441        if (passdb_idmap_domain != NULL) {
    432442                return passdb_idmap_domain;
  • vendor/current/source3/winbindd/idmap_util.c

    r414 r594  
    2424#undef DBGC_CLASS
    2525#define DBGC_CLASS DBGC_IDMAP
     26
     27/*****************************************************************
     28 Returns true if the request was for a specific domain, or
     29 for a sid we are authoritative for - BUILTIN, or our own domain.
     30*****************************************************************/
     31
     32static bool is_specific_domain_request(const char *dom_name, DOM_SID *sid)
     33{
     34        if (dom_name && dom_name[0] != '\0') {
     35                return true;
     36        }
     37        if (sid_check_is_in_builtin(sid) ||
     38                        sid_check_is_in_our_domain(sid)) {
     39                return true;
     40        }
     41        return false;
     42}
    2643
    2744/*****************************************************************
     
    195212        }
    196213
    197         if (dom_name[0] != '\0') {
     214        if (is_specific_domain_request(dom_name, sid)) {
    198215                /*
    199                  * We had the task to go to a specific domain which
    200                  * could not answer our request. Fail.
     216                 * We had the task to go to a specific domain or
     217                 * a domain for which we are authoritative for and
     218                 * it could not answer our request. Fail.
    201219                 */
    202220                if (winbindd_use_idmap_cache()) {
     
    276294        }
    277295
    278         if (domname[0] != '\0') {
     296        if (is_specific_domain_request(domname, sid)) {
    279297                /*
    280                  * We had the task to go to a specific domain which
    281                  * could not answer our request. Fail.
     298                 * We had the task to go to a specific domain or
     299                 * a domain for which we are authoritative for and
     300                 * it could not answer our request. Fail.
    282301                 */
    283302                if (winbindd_use_idmap_cache()) {
  • vendor/current/source3/winbindd/wb_dsgetdcname.c

    r414 r594  
    9898                return;
    9999        }
     100        if (!NT_STATUS_IS_OK(result)) {
     101                tevent_req_nterror(req, result);
     102                return;
     103        }
    100104        tevent_req_done(req);
    101105}
  • vendor/current/source3/winbindd/wb_gettoken.c

    r414 r594  
    107107         * Expand our domain's aliases
    108108         */
    109         domain = find_our_domain();
     109        domain = find_domain_from_sid_noinit(get_global_sam_sid());
    110110        if (domain == NULL) {
    111111                tevent_req_nterror(req, NT_STATUS_INTERNAL_ERROR);
     
    138138                return;
    139139        }
    140         domain = find_our_domain();
     140        domain = find_domain_from_sid_noinit(get_global_sam_sid());
    141141        if (!wb_add_rids_to_sids(state, &state->num_sids, &state->sids,
    142142                                 &domain->sid, num_rids, rids)) {
  • vendor/current/source3/winbindd/winbindd.h

    r427 r594  
    168168
    169169        bool can_do_ncacn_ip_tcp;
     170        bool can_do_validation6;
    170171
    171172        /* Lookup methods for this domain (LDAP or RPC) */
  • vendor/current/source3/winbindd/winbindd_cm.c

    r587 r594  
    836836        }
    837837
    838         if (ntohs(peeraddr_in->sin_port) == 139) {
    839                 struct nmb_name calling;
    840                 struct nmb_name called;
    841 
    842                 make_nmb_name(&calling, global_myname(), 0x0);
    843                 make_nmb_name(&called, "*SMBSERVER", 0x20);
    844 
    845                 if (!cli_session_request(*cli, &calling, &called)) {
    846                         DEBUG(8, ("cli_session_request failed for %s\n",
    847                                   controller));
    848                         result = NT_STATUS_UNSUCCESSFUL;
    849                         goto done;
    850                 }
    851         }
    852 
    853838        result = cli_negprot(*cli);
    854839
     
    13551340        int num_addrs = 0;
    13561341
    1357         int i, fd_index;
     1342        int i;
     1343        size_t fd_index;
     1344
     1345        NTSTATUS status;
    13581346
    13591347        *fd = -1;
     
    13731361                        return False;
    13741362                }
    1375 
    1376                 if (!add_string_to_array(mem_ctx, dcs[i].name,
    1377                                     &dcnames, &num_dcnames)) {
    1378                         return False;
    1379                 }
    1380                 if (!add_sockaddr_to_array(mem_ctx, &dcs[i].ss, 139,
    1381                                       &addrs, &num_addrs)) {
    1382                         return False;
    1383                 }
    13841363        }
    13851364
     
    13901369                return False;
    13911370
    1392         /* 5 second timeout. */
    1393         if (!open_any_socket_out(addrs, num_addrs, 5000, &fd_index, fd) ) {
     1371        status = smbsock_any_connect(addrs, dcnames, num_addrs,
     1372                                     fd, &fd_index, NULL);
     1373        if (!NT_STATUS_IS_OK(status)) {
    13941374                for (i=0; i<num_dcs; i++) {
    13951375                        char ab[INET6_ADDRSTRLEN];
    13961376                        print_sockaddr(ab, sizeof(ab), &dcs[i].ss);
    1397                         DEBUG(10, ("find_new_dc: open_any_socket_out failed for "
     1377                        DEBUG(10, ("find_new_dc: smbsock_any_connect failed for "
    13981378                                "domain %s address %s. Error was %s\n",
    1399                                 domain->name, ab, strerror(errno) ));
     1379                                   domain->name, ab, nt_errstr(status) ));
    14001380                        winbind_add_failed_connection_entry(domain,
    14011381                                dcs[i].name, NT_STATUS_UNSUCCESSFUL);
     
    14991479                        && (resolve_name(domain->dcname, &domain->dcaddr, 0x20, true)))
    15001480                {
    1501                         struct sockaddr_storage *addrs = NULL;
    1502                         int num_addrs = 0;
    1503                         int dummy = 0;
    1504 
    1505                         if (!add_sockaddr_to_array(mem_ctx, &domain->dcaddr, 445, &addrs, &num_addrs)) {
    1506                                 set_domain_offline(domain);
    1507                                 talloc_destroy(mem_ctx);
    1508                                 return NT_STATUS_NO_MEMORY;
    1509                         }
    1510                         if (!add_sockaddr_to_array(mem_ctx, &domain->dcaddr, 139, &addrs, &num_addrs)) {
    1511                                 set_domain_offline(domain);
    1512                                 talloc_destroy(mem_ctx);
    1513                                 return NT_STATUS_NO_MEMORY;
    1514                         }
    1515 
    1516                         /* 5 second timeout. */
    1517                         if (!open_any_socket_out(addrs, num_addrs, 5000, &dummy, &fd)) {
     1481                        NTSTATUS status;
     1482
     1483                        status = smbsock_connect(&domain->dcaddr, NULL, NULL,
     1484                                                 &fd, NULL);
     1485                        if (!NT_STATUS_IS_OK(status)) {
    15181486                                fd = -1;
    15191487                        }
     
    19781946
    19791947        domain->can_do_ncacn_ip_tcp = domain->active_directory;
     1948        domain->can_do_validation6 = domain->active_directory;
    19801949
    19811950        TALLOC_FREE(cli);
  • vendor/current/source3/winbindd/winbindd_dual_srv.c

    r587 r594  
    379379                return status;
    380380        }
     381
     382        *r->out.domain_name = talloc_move(r->out.domain_name, &domain_name);
    381383
    382384        result = talloc_array(p->mem_ctx, struct wbint_Principal,
  • vendor/current/source3/winbindd/winbindd_getgrent.c

    r414 r594  
    188188                return NT_STATUS_NO_MEMORY;
    189189        }
     190        state->groups = (struct winbindd_gr *)result;
    190191
    191192        for (i=0; i<state->num_groups; i++) {
  • vendor/current/source3/winbindd/winbindd_lookuprids.c

    r414 r594  
    6262        }
    6363
    64         domain = find_domain_from_sid_noinit(&sid);
     64        domain = find_lookup_domain_from_sid(&sid);
    6565        if (domain == NULL) {
    6666                DEBUG(5, ("Domain for sid %s not found\n",
     
    8484
    8585        subreq = rpccli_wbint_LookupRids_send(
    86                 state, ev, domain->child.rpccli, &state->rids, &state->names);
     86                state, ev, domain->child.rpccli, &state->rids,
     87                &state->domain_name, &state->names);
    8788        if (tevent_req_nomem(subreq, req)) {
    8889                return tevent_req_post(req, ev);
  • vendor/current/source3/winbindd/winbindd_pam.c

    r587 r594  
    11861186                                  const char *workstation,
    11871187                                  const uint8 chal[8],
     1188                                  uint16_t validation_level,
    11881189                                  DATA_BLOB lm_response,
    11891190                                  DATA_BLOB nt_response,
     
    12971298        do {
    12981299                netlogon_fn_t logon_fn;
     1300                const struct cli_pipe_auth_data *auth;
     1301                uint32_t neg_flags = 0;
    12991302
    13001303                ZERO_STRUCTP(my_info3);
     
    13061309                        DEBUG(3, ("could not open handle to NETLOGON pipe\n"));
    13071310                        goto done;
     1311                }
     1312                auth = netlogon_pipe->auth;
     1313                if (netlogon_pipe->dc) {
     1314                        neg_flags = netlogon_pipe->dc->negotiate_flags;
    13081315                }
    13091316
     
    13271334                 *
    13281335                 *  -- abartlet 21 April 2008
     1336                 *
     1337                 * It's also important to use NetlogonValidationSamInfo4 (6),
     1338                 * because it relies on the rpc transport encryption
     1339                 * and avoids using the global netlogon schannel
     1340                 * session key to en/decrypt secret information
     1341                 * like the user_session_key for network logons.
     1342                 *
     1343                 * [MS-APDS] 3.1.5.2 NTLM Network Logon
     1344                 * says NETLOGON_NEG_CROSS_FOREST_TRUSTS and
     1345                 * NETLOGON_NEG_AUTHENTICATED_RPC set together
     1346                 * are the indication that the server supports
     1347                 * NetlogonValidationSamInfo4 (6). And must only
     1348                 * be used if "SealSecureChannel" is used.
     1349                 *
     1350                 * -- metze 4 February 2011
    13291351                 */
     1352
     1353                if (auth == NULL) {
     1354                        domain->can_do_validation6 = false;
     1355                } else if (auth->auth_type != PIPE_AUTH_TYPE_SCHANNEL) {
     1356                        domain->can_do_validation6 = false;
     1357                } else if (auth->auth_level != DCERPC_AUTH_LEVEL_PRIVACY) {
     1358                        domain->can_do_validation6 = false;
     1359                } else if (!(neg_flags & NETLOGON_NEG_CROSS_FOREST_TRUSTS)) {
     1360                        domain->can_do_validation6 = false;
     1361                } else if (!(neg_flags & NETLOGON_NEG_AUTHENTICATED_RPC)) {
     1362                        domain->can_do_validation6 = false;
     1363                }
    13301364
    13311365                logon_fn = contact_domain->can_do_samlogon_ex
     
    13411375                                  global_myname(),        /* workstation */
    13421376                                  chal,
     1377                                  domain->can_do_validation6 ? 6 : 3,
    13431378                                  lm_resp,
    13441379                                  nt_resp,
    13451380                                  &my_info3);
    1346                 attempts += 1;
    13471381
    13481382                if ((NT_STATUS_V(result) == DCERPC_FAULT_OP_RNG_ERROR)
     
    13511385                                  "retrying with NetSamLogon\n"));
    13521386                        contact_domain->can_do_samlogon_ex = false;
     1387                        /*
     1388                         * It's likely that the server also does not support
     1389                         * validation level 6
     1390                         */
     1391                        domain->can_do_validation6 = false;
    13531392                        retry = true;
    13541393                        continue;
    13551394                }
     1395
     1396                if (domain->can_do_validation6 &&
     1397                    (NT_STATUS_EQUAL(result, NT_STATUS_INVALID_INFO_CLASS) ||
     1398                     NT_STATUS_EQUAL(result, NT_STATUS_INVALID_PARAMETER) ||
     1399                     NT_STATUS_EQUAL(result, NT_STATUS_BUFFER_TOO_SMALL))) {
     1400                        DEBUG(3,("Got a DC that can not do validation level 6, "
     1401                                  "retrying with level 3\n"));
     1402                        domain->can_do_validation6 = false;
     1403                        retry = true;
     1404                        continue;
     1405                }
     1406
     1407                /*
     1408                 * we increment this after the "feature negotiation"
     1409                 * for can_do_samlogon_ex and can_do_validation6
     1410                 */
     1411                attempts += 1;
    13561412
    13571413                /* We have to try a second time as cm_connect_netlogon
     
    18901946        do {
    18911947                netlogon_fn_t logon_fn;
     1948                const struct cli_pipe_auth_data *auth;
     1949                uint32_t neg_flags = 0;
    18921950
    18931951                retry = false;
     
    19001958                                  nt_errstr(result)));
    19011959                        goto done;
     1960                }
     1961                auth = netlogon_pipe->auth;
     1962                if (netlogon_pipe->dc) {
     1963                        neg_flags = netlogon_pipe->dc->negotiate_flags;
     1964                }
     1965
     1966                if (auth == NULL) {
     1967                        domain->can_do_validation6 = false;
     1968                } else if (auth->auth_type != PIPE_AUTH_TYPE_SCHANNEL) {
     1969                        domain->can_do_validation6 = false;
     1970                } else if (auth->auth_level != DCERPC_AUTH_LEVEL_PRIVACY) {
     1971                        domain->can_do_validation6 = false;
     1972                } else if (!(neg_flags & NETLOGON_NEG_CROSS_FOREST_TRUSTS)) {
     1973                        domain->can_do_validation6 = false;
     1974                } else if (!(neg_flags & NETLOGON_NEG_AUTHENTICATED_RPC)) {
     1975                        domain->can_do_validation6 = false;
    19021976                }
    19031977
     
    19151989                                  workstation, /* We carefully set this above so use it... */
    19161990                                  state->request->data.auth_crap.chal,
     1991                                  domain->can_do_validation6 ? 6 : 3,
    19171992                                  lm_resp,
    19181993                                  nt_resp,
     
    19241999                                  "retrying with NetSamLogon\n"));
    19252000                        contact_domain->can_do_samlogon_ex = false;
     2001                        /*
     2002                         * It's likely that the server also does not support
     2003                         * validation level 6
     2004                         */
     2005                        domain->can_do_validation6 = false;
    19262006                        retry = true;
    19272007                        continue;
    19282008                }
    19292009
     2010                if (domain->can_do_validation6 &&
     2011                    (NT_STATUS_EQUAL(result, NT_STATUS_INVALID_INFO_CLASS) ||
     2012                     NT_STATUS_EQUAL(result, NT_STATUS_INVALID_PARAMETER) ||
     2013                     NT_STATUS_EQUAL(result, NT_STATUS_BUFFER_TOO_SMALL))) {
     2014                        DEBUG(3,("Got a DC that can not do validation level 6, "
     2015                                  "retrying with level 3\n"));
     2016                        domain->can_do_validation6 = false;
     2017                        retry = true;
     2018                        continue;
     2019                }
     2020
     2021                /*
     2022                 * we increment this after the "feature negotiation"
     2023                 * for can_do_samlogon_ex and can_do_validation6
     2024                 */
    19302025                attempts += 1;
    19312026
  • vendor/current/source3/winbindd/winbindd_rpc.c

    r414 r594  
    8585                                                      &returned_size,
    8686                                                      &disp_info);
     87
     88                if (!NT_STATUS_IS_OK(result)) {
     89                        if (!NT_STATUS_EQUAL(result, STATUS_MORE_ENTRIES)) {
     90                                return result;
     91                        }
     92                }
     93
    8794                num_dom_users = disp_info.info1.count;
    8895                start_idx += disp_info.info1.count;
     
    12311238        rpccli_set_timeout(cli, orig_timeout);
    12321239
     1240        if (NT_STATUS_V(status) == DCERPC_FAULT_ACCESS_DENIED ||
     1241            NT_STATUS_V(status) == DCERPC_FAULT_SEC_PKG_ERROR) {
     1242                /*
     1243                 * This can happen if the schannel key is not
     1244                 * valid anymore, we need to invalidate the
     1245                 * all connections to the dc and reestablish
     1246                 * a netlogon connection first.
     1247                 */
     1248                invalidate_cm_connection(&domain->conn);
     1249                status = NT_STATUS_ACCESS_DENIED;
     1250        }
     1251
    12331252        if (!NT_STATUS_IS_OK(status)) {
    12341253                return status;
     
    12971316        /* And restore our original timeout. */
    12981317        rpccli_set_timeout(cli, orig_timeout);
     1318
     1319        if (NT_STATUS_V(status) == DCERPC_FAULT_ACCESS_DENIED ||
     1320            NT_STATUS_V(status) == DCERPC_FAULT_SEC_PKG_ERROR) {
     1321                /*
     1322                 * This can happen if the schannel key is not
     1323                 * valid anymore, we need to invalidate the
     1324                 * all connections to the dc and reestablish
     1325                 * a netlogon connection first.
     1326                 */
     1327                invalidate_cm_connection(&domain->conn);
     1328                status = NT_STATUS_ACCESS_DENIED;
     1329        }
    12991330
    13001331        if (!NT_STATUS_IS_OK(status)) {
Note: See TracChangeset for help on using the changeset viewer.