Ignore:
Timestamp:
Jul 1, 2011, 8:40:10 AM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Samba 3.5: Update trunk to 3.5.6

File:
1 edited

Legend:

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

    r480 r590  
    20172017***********************************************************************/
    20182018
    2019 static bool cm_get_schannel_creds(struct winbindd_domain *domain,
     2019static NTSTATUS cm_get_schannel_creds(struct winbindd_domain *domain,
    20202020                                   struct netlogon_creds_CredentialState **ppdc)
    20212021{
    2022         NTSTATUS result;
     2022        NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
    20232023        struct rpc_pipe_client *netlogon_pipe;
    20242024
    20252025        if (lp_client_schannel() == False) {
    2026                 return False;
     2026                return NT_STATUS_CANT_ACCESS_DOMAIN_INFO;;
    20272027        }
    20282028
    20292029        result = cm_connect_netlogon(domain, &netlogon_pipe);
    20302030        if (!NT_STATUS_IS_OK(result)) {
    2031                 return False;
     2031                return result;
    20322032        }
    20332033
     
    20362036
    20372037        if (!domain->conn.netlogon_pipe->dc) {
    2038                 return false;
     2038                return NT_STATUS_INTERNAL_ERROR; /* This shouldn't happen. */
    20392039        }
    20402040
    20412041        *ppdc = domain->conn.netlogon_pipe->dc;
    2042         return True;
     2042        return NT_STATUS_OK;
    20432043}
    20442044
     
    21372137        /* Fall back to schannel if it's a W2K pre-SP1 box. */
    21382138
    2139         if (!cm_get_schannel_creds(domain, &p_creds)) {
     2139        result = cm_get_schannel_creds(domain, &p_creds);
     2140        if (!NT_STATUS_IS_OK(result)) {
    21402141                /* If this call fails - conn->cli can now be NULL ! */
    21412142                DEBUG(10, ("cm_connect_sam: Could not get schannel auth info "
    2142                            "for domain %s, trying anon\n", domain->name));
     2143                           "for domain %s (error %s), trying anon\n",
     2144                        domain->name,
     2145                        nt_errstr(result) ));
    21432146                goto anonymous;
    21442147        }
     
    22322235{
    22332236        struct winbindd_cm_conn *conn;
     2237        struct netlogon_creds_CredentialState *creds;
    22342238        NTSTATUS status;
    22352239
     
    22522256        TALLOC_FREE(conn->lsa_pipe_tcp);
    22532257
    2254         status = cli_rpc_pipe_open_schannel(conn->cli,
    2255                                             &ndr_table_lsarpc.syntax_id,
    2256                                             NCACN_IP_TCP,
    2257                                             DCERPC_AUTH_LEVEL_PRIVACY,
    2258                                             domain->name,
    2259                                             &conn->lsa_pipe_tcp);
     2258        status = cm_get_schannel_creds(domain, &creds);
    22602259        if (!NT_STATUS_IS_OK(status)) {
    2261                 DEBUG(10,("cli_rpc_pipe_open_schannel failed: %s\n",
     2260                goto done;
     2261        }
     2262
     2263        status = cli_rpc_pipe_open_schannel_with_key(conn->cli,
     2264                                                     &ndr_table_lsarpc.syntax_id,
     2265                                                     NCACN_IP_TCP,
     2266                                                     DCERPC_AUTH_LEVEL_PRIVACY,
     2267                                                     domain->name,
     2268                                                     &creds,
     2269                                                     &conn->lsa_pipe_tcp);
     2270        if (!NT_STATUS_IS_OK(status)) {
     2271                DEBUG(10,("cli_rpc_pipe_open_schannel_with_key failed: %s\n",
    22622272                        nt_errstr(status)));
    22632273                goto done;
     
    23392349        /* Fall back to schannel if it's a W2K pre-SP1 box. */
    23402350
    2341         if (!cm_get_schannel_creds(domain, &p_creds)) {
     2351        result = cm_get_schannel_creds(domain, &p_creds);
     2352        if (!NT_STATUS_IS_OK(result)) {
    23422353                /* If this call fails - conn->cli can now be NULL ! */
    23432354                DEBUG(10, ("cm_connect_lsa: Could not get schannel auth info "
    2344                            "for domain %s, trying anon\n", domain->name));
     2355                           "for domain %s (error %s), trying anon\n",
     2356                        domain->name,
     2357                        nt_errstr(result) ));
    23452358                goto anonymous;
    23462359        }
Note: See TracChangeset for help on using the changeset viewer.