Ignore:
Timestamp:
Jul 2, 2011, 3:35:33 PM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Samba 3.5: Update trunk to 3.5.8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/source3/winbindd/winbindd_pam.c

    r590 r596  
    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
Note: See TracChangeset for help on using the changeset viewer.