Ignore:
Timestamp:
May 24, 2009, 7:17:10 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update Samba 3.3 to 3.3.1

Location:
branches/samba-3.3.x/source/rpc_server
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/rpc_server/srv_netlog_nt.c

    r206 r221  
    475475        struct netr_Credential srv_chal_out;
    476476
    477         /* We use this as the key to store the creds: */
    478         /* r->in.computer_name */
    479 
    480         if (!p->dc || !p->dc->challenge_sent) {
    481                 DEBUG(0,("_netr_ServerAuthenticate2: no challenge sent to client %s\n",
    482                         r->in.computer_name));
    483                 return NT_STATUS_ACCESS_DENIED;
    484         }
    485 
    486         if ( (lp_server_schannel() == true) &&
    487              ((*r->in.negotiate_flags & NETLOGON_NEG_SCHANNEL) == 0) ) {
    488 
    489                 /* schannel must be used, but client did not offer it. */
    490                 DEBUG(0,("_netr_ServerAuthenticate2: schannel required but client failed "
    491                         "to offer it. Client was %s\n",
    492                         r->in.account_name));
    493                 return NT_STATUS_ACCESS_DENIED;
    494         }
    495 
    496         status = get_md4pw((char *)p->dc->mach_pw,
    497                            r->in.account_name,
    498                            r->in.secure_channel_type);
    499         if (!NT_STATUS_IS_OK(status)) {
    500                 DEBUG(0,("_netr_ServerAuthenticate2: failed to get machine password for "
    501                         "account %s: %s\n",
    502                         r->in.account_name, nt_errstr(status) ));
    503                 /* always return NT_STATUS_ACCESS_DENIED */
    504                 return NT_STATUS_ACCESS_DENIED;
    505         }
    506 
    507         /* From the client / server challenges and md4 password, generate sess key */
    508         creds_server_init(*r->in.negotiate_flags,
    509                         p->dc,
    510                         &p->dc->clnt_chal,      /* Stored client chal. */
    511                         &p->dc->srv_chal,       /* Stored server chal. */
    512                         p->dc->mach_pw,
    513                         &srv_chal_out);
    514 
    515         /* Check client credentials are valid. */
    516         if (!netlogon_creds_server_check(p->dc, r->in.credentials)) {
    517                 DEBUG(0,("_netr_ServerAuthenticate2: netlogon_creds_server_check failed. Rejecting auth "
    518                         "request from client %s machine account %s\n",
    519                         r->in.computer_name,
    520                         r->in.account_name));
    521                 return NT_STATUS_ACCESS_DENIED;
    522         }
     477        /* According to Microsoft (see bugid #6099)
     478         * Windows 7 looks at the negotiate_flags
     479         * returned in this structure *even if the
     480         * call fails with access denied ! So in order
     481         * to allow Win7 to connect to a Samba NT style
     482         * PDC we set the flags before we know if it's
     483         * an error or not.
     484         */
    523485
    524486        /* 0x000001ff */
     
    537499        }
    538500
     501        *r->out.negotiate_flags = srv_flgs;
     502
     503        /* We use this as the key to store the creds: */
     504        /* r->in.computer_name */
     505
     506        if (!p->dc || !p->dc->challenge_sent) {
     507                DEBUG(0,("_netr_ServerAuthenticate2: no challenge sent to client %s\n",
     508                        r->in.computer_name));
     509                return NT_STATUS_ACCESS_DENIED;
     510        }
     511
     512        if ( (lp_server_schannel() == true) &&
     513             ((*r->in.negotiate_flags & NETLOGON_NEG_SCHANNEL) == 0) ) {
     514
     515                /* schannel must be used, but client did not offer it. */
     516                DEBUG(0,("_netr_ServerAuthenticate2: schannel required but client failed "
     517                        "to offer it. Client was %s\n",
     518                        r->in.account_name));
     519                return NT_STATUS_ACCESS_DENIED;
     520        }
     521
     522        status = get_md4pw((char *)p->dc->mach_pw,
     523                           r->in.account_name,
     524                           r->in.secure_channel_type);
     525        if (!NT_STATUS_IS_OK(status)) {
     526                DEBUG(0,("_netr_ServerAuthenticate2: failed to get machine password for "
     527                        "account %s: %s\n",
     528                        r->in.account_name, nt_errstr(status) ));
     529                /* always return NT_STATUS_ACCESS_DENIED */
     530                return NT_STATUS_ACCESS_DENIED;
     531        }
     532
     533        /* From the client / server challenges and md4 password, generate sess key */
     534        creds_server_init(*r->in.negotiate_flags,
     535                        p->dc,
     536                        &p->dc->clnt_chal,      /* Stored client chal. */
     537                        &p->dc->srv_chal,       /* Stored server chal. */
     538                        p->dc->mach_pw,
     539                        &srv_chal_out);
     540
     541        /* Check client credentials are valid. */
     542        if (!netlogon_creds_server_check(p->dc, r->in.credentials)) {
     543                DEBUG(0,("_netr_ServerAuthenticate2: netlogon_creds_server_check failed. Rejecting auth "
     544                        "request from client %s machine account %s\n",
     545                        r->in.computer_name,
     546                        r->in.account_name));
     547                return NT_STATUS_ACCESS_DENIED;
     548        }
    539549        /* set up the LSA AUTH 2 response */
    540550        memcpy(r->out.return_credentials->data, &srv_chal_out.data,
    541551               sizeof(r->out.return_credentials->data));
    542         *r->out.negotiate_flags = srv_flgs;
    543552
    544553        fstrcpy(p->dc->mach_acct, r->in.account_name);
     
    689698
    690699        memcpy(r->out.return_authenticator, &cred_out,
    691                sizeof(r->out.return_authenticator));
     700               sizeof(*(r->out.return_authenticator)));
    692701
    693702        TALLOC_FREE(sampass);
     
    11631172****************************************************************/
    11641173
    1165 WERROR _netr_NETRLOGONDUMMYROUTINE1(pipes_struct *p,
    1166                                     struct netr_NETRLOGONDUMMYROUTINE1 *r)
    1167 {
    1168         p->rng_fault_state = true;
    1169         return WERR_NOT_SUPPORTED;
     1174NTSTATUS _netr_LogonGetCapabilities(pipes_struct *p,
     1175                                    struct netr_LogonGetCapabilities *r)
     1176{
     1177        return NT_STATUS_NOT_IMPLEMENTED;
    11701178}
    11711179
  • branches/samba-3.3.x/source/rpc_server/srv_pipe_hnd.c

    r206 r221  
    583583         */
    584584       
    585         if(prs_offset(&p->in_data.data) + data_len > 15*1024*1024) {
     585        if(prs_offset(&p->in_data.data) + data_len > MAX_RPC_DATA_SIZE) {
    586586                DEBUG(0,("process_request_pdu: rpc data buffer too large (%u) + (%u)\n",
    587587                                (unsigned int)prs_data_size(&p->in_data.data), (unsigned int)data_len ));
  • branches/samba-3.3.x/source/rpc_server/srv_samr_nt.c

    r206 r221  
    11781178        *r->out.sam = samr_array;
    11791179        *r->out.num_entries = num_groups;
    1180         /* this was missing, IMHO:
    11811180        *r->out.resume_handle = num_groups + *r->in.resume_handle;
    1182         */
    11831181
    11841182        DEBUG(5,("_samr_EnumDomainGroups: %d\n", __LINE__));
  • branches/samba-3.3.x/source/rpc_server/srv_spoolss_nt.c

    r206 r221  
    47304730        }
    47314731
     4732        if (offered > MAX_RPC_DATA_SIZE) {
     4733                return WERR_INVALID_PARAM;
     4734        }
     4735
    47324736        rpcbuf_move(q_u->buffer, &r_u->buffer);
    47334737        buffer = r_u->buffer;
     
    50845088
    50855089        if (!q_u->buffer && (offered!=0)) {
     5090                return WERR_INVALID_PARAM;
     5091        }
     5092
     5093        if (offered > MAX_RPC_DATA_SIZE) {
    50865094                return WERR_INVALID_PARAM;
    50875095        }
     
    57455753
    57465754        if (!q_u->buffer && (offered!=0)) {
     5755                return WERR_INVALID_PARAM;
     5756        }
     5757
     5758        if (offered > MAX_RPC_DATA_SIZE) {
    57475759                return WERR_INVALID_PARAM;
    57485760        }
     
    68226834        }
    68236835
     6836        if (offered > MAX_RPC_DATA_SIZE) {
     6837                return WERR_INVALID_PARAM;
     6838        }
     6839
    68246840        rpcbuf_move(q_u->buffer, &r_u->buffer);
    68256841        buffer = r_u->buffer;
     
    71987214        }
    71997215
     7216        if (offered > MAX_RPC_DATA_SIZE) {
     7217                return WERR_INVALID_PARAM;
     7218        }
     7219
    72007220        rpcbuf_move(q_u->buffer, &r_u->buffer);
    72017221        buffer = r_u->buffer;
     
    72657285        }
    72667286
     7287        if (offered > MAX_RPC_DATA_SIZE) {
     7288                return WERR_INVALID_PARAM;
     7289        }
     7290
    72677291        rpcbuf_move(q_u->buffer, &r_u->buffer);
    72687292        buffer = r_u->buffer;
     
    76707694
    76717695        if (!q_u->buffer && (offered!=0)) {
     7696                return WERR_INVALID_PARAM;
     7697        }
     7698
     7699        if (offered > MAX_RPC_DATA_SIZE) {
    76727700                return WERR_INVALID_PARAM;
    76737701        }
     
    80828110        }
    80838111
     8112        if (offered > MAX_RPC_DATA_SIZE) {
     8113                return WERR_INVALID_PARAM;
     8114        }
     8115
    80848116        rpcbuf_move(q_u->buffer, &r_u->buffer);
    80858117        buffer = r_u->buffer;
     
    87098741        }
    87108742
     8743        if (offered > MAX_RPC_DATA_SIZE) {
     8744                return WERR_INVALID_PARAM;
     8745        }
     8746
    87118747        rpcbuf_move(q_u->buffer, &r_u->buffer);
    87128748        buffer = r_u->buffer;
     
    87888824        }
    87898825
     8826        if (offered > MAX_RPC_DATA_SIZE) {
     8827                return WERR_INVALID_PARAM;
     8828        }
     8829
    87908830        rpcbuf_move(q_u->buffer, &r_u->buffer);
    87918831        buffer = r_u->buffer;
     
    89138953
    89148954        if (!q_u->buffer && (offered!=0)) {
     8955                return WERR_INVALID_PARAM;
     8956        }
     8957
     8958        if (offered > MAX_RPC_DATA_SIZE) {
    89158959                return WERR_INVALID_PARAM;
    89168960        }
     
    90899133
    90909134        if (!q_u->buffer && (offered!=0)) {
     9135                return WERR_INVALID_PARAM;
     9136        }
     9137
     9138        if (offered > MAX_RPC_DATA_SIZE) {
    90919139                return WERR_INVALID_PARAM;
    90929140        }
     
    97339781        }
    97349782
     9783        if (offered > MAX_RPC_DATA_SIZE) {
     9784                return WERR_INVALID_PARAM;
     9785        }
     9786
    97359787        rpcbuf_move(q_u->buffer, &r_u->buffer);
    97369788        buffer = r_u->buffer;
  • branches/samba-3.3.x/source/rpc_server/srv_srvsvc_nt.c

    r206 r221  
    23232323        /*allow one struct srvsvc_NetDiskInfo0 for null terminator*/
    23242324
     2325        r->out.info->count = 0;
     2326
    23252327        for(i = 0; i < MAX_SERVER_DISK_ENTRIES -1 && (disk_name = next_server_disk_enum(&resume)); i++) {
    23262328
  • branches/samba-3.3.x/source/rpc_server/srv_svcctl_nt.c

    r206 r221  
    140140        size_t i = 0;
    141141        SEC_DESC *sd;
    142         SEC_ACL *acl;
     142        SEC_ACL *theacl;
    143143        size_t sd_size;
    144144
     
    156156        /* create the security descriptor */
    157157
    158         if ( !(acl = make_sec_acl(ctx, NT4_ACL_REVISION, i, ace)) )
     158        if ( !(theacl = make_sec_acl(ctx, NT4_ACL_REVISION, i, ace)) )
    159159                return NULL;
    160160
    161161        if ( !(sd = make_sec_desc(ctx, SECURITY_DESCRIPTOR_REVISION_1,
    162162                                  SEC_DESC_SELF_RELATIVE, NULL, NULL, NULL,
    163                                   acl, &sd_size)) )
     163                                  theacl, &sd_size)) )
    164164                return NULL;
    165165
Note: See TracChangeset for help on using the changeset viewer.