Ignore:
Timestamp:
Jun 17, 2009, 2:19:52 PM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.3 branch to 3.3.5

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

Legend:

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

    r221 r274  
    473473        NTSTATUS status;
    474474        uint32_t srv_flgs;
     475        /* r->in.negotiate_flags is an aliased pointer to r->out.negotiate_flags,
     476         * so use a copy to avoid destroying the client values. */
     477        uint32_t in_neg_flags = *r->in.negotiate_flags;
    475478        struct netr_Credential srv_chal_out;
    476479
     
    478481         * Windows 7 looks at the negotiate_flags
    479482         * returned in this structure *even if the
    480          * call fails with access denied ! So in order
     483         * call fails with access denied* ! So in order
    481484         * to allow Win7 to connect to a Samba NT style
    482485         * PDC we set the flags before we know if it's
     
    495498                   NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL;
    496499
     500        /* Ensure we support strong (128-bit) keys. */
     501        if (in_neg_flags & NETLOGON_NEG_128BIT) {
     502                srv_flgs |= NETLOGON_NEG_128BIT;
     503        }
     504
    497505        if (lp_server_schannel() != false) {
    498506                srv_flgs |= NETLOGON_NEG_SCHANNEL;
    499507        }
    500 
    501         *r->out.negotiate_flags = srv_flgs;
    502508
    503509        /* We use this as the key to store the creds: */
     
    507513                DEBUG(0,("_netr_ServerAuthenticate2: no challenge sent to client %s\n",
    508514                        r->in.computer_name));
    509                 return NT_STATUS_ACCESS_DENIED;
     515                status = NT_STATUS_ACCESS_DENIED;
     516                goto out;
    510517        }
    511518
    512519        if ( (lp_server_schannel() == true) &&
    513              ((*r->in.negotiate_flags & NETLOGON_NEG_SCHANNEL) == 0) ) {
     520             ((in_neg_flags & NETLOGON_NEG_SCHANNEL) == 0) ) {
    514521
    515522                /* schannel must be used, but client did not offer it. */
     
    517524                        "to offer it. Client was %s\n",
    518525                        r->in.account_name));
    519                 return NT_STATUS_ACCESS_DENIED;
     526                status = NT_STATUS_ACCESS_DENIED;
     527                goto out;
    520528        }
    521529
     
    528536                        r->in.account_name, nt_errstr(status) ));
    529537                /* always return NT_STATUS_ACCESS_DENIED */
    530                 return NT_STATUS_ACCESS_DENIED;
     538                status = NT_STATUS_ACCESS_DENIED;
     539                goto out;
    531540        }
    532541
    533542        /* From the client / server challenges and md4 password, generate sess key */
    534         creds_server_init(*r->in.negotiate_flags,
     543        creds_server_init(in_neg_flags,
    535544                        p->dc,
    536545                        &p->dc->clnt_chal,      /* Stored client chal. */
     
    545554                        r->in.computer_name,
    546555                        r->in.account_name));
    547                 return NT_STATUS_ACCESS_DENIED;
     556                status = NT_STATUS_ACCESS_DENIED;
     557                goto out;
    548558        }
    549559        /* set up the LSA AUTH 2 response */
     
    563573                                            p->dc);
    564574        unbecome_root();
    565 
    566         return NT_STATUS_OK;
     575        status = NT_STATUS_OK;
     576
     577  out:
     578
     579        *r->out.negotiate_flags = srv_flgs;
     580        return status;
    567581}
    568582
  • branches/samba-3.3.x/source/rpc_server/srv_samr_nt.c

    r224 r274  
    863863                  sid_string_dbg(&pol_sid)));
    864864
    865         status = access_check_samr_function(acc_granted,
    866                                             STD_RIGHT_READ_CONTROL_ACCESS,
    867                                             "_samr_QuerySecurity");
    868         if (!NT_STATUS_IS_OK(status)) {
    869                 return status;
    870         }
    871 
    872865        /* Check what typ of SID is beeing queried (e.g Domain SID, User SID, Group SID) */
    873866
     
    11661159                                  num_groups, groups);
    11671160
     1161        if (MAX_SAM_ENTRIES <= num_groups) {
     1162                status = STATUS_MORE_ENTRIES;
     1163        } else {
     1164                status = NT_STATUS_OK;
     1165        }
     1166
    11681167        samr_array->count = num_groups;
    11691168        samr_array->entries = samr_entries;
     
    12341233        DEBUG(5,("_samr_EnumDomainAliases: %d\n", __LINE__));
    12351234
     1235        if (MAX_SAM_ENTRIES <= num_aliases) {
     1236                status = STATUS_MORE_ENTRIES;
     1237        } else {
     1238                status = NT_STATUS_OK;
     1239        }
     1240
    12361241        samr_array->count = num_aliases;
    12371242        samr_array->entries = samr_entries;
     
    14751480                DEBUG(5,("_samr_QueryDisplayInfo: Nothing in BUILTIN\n"));
    14761481                return NT_STATUS_OK;
    1477         }
    1478 
    1479         status = access_check_samr_function(info->acc_granted,
    1480                                             SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS,
    1481                                             "_samr_QueryDisplayInfo");
    1482         if (!NT_STATUS_IS_OK(status)) {
    1483                 return status;
    14841482        }
    14851483
     
    20662064                return NT_STATUS_INVALID_HANDLE;
    20672065
    2068         status = access_check_samr_function(acc_granted,
    2069                                             0, /* Don't know the acc_bits yet */
    2070                                             "_samr_LookupRids");
    2071         if (!NT_STATUS_IS_OK(status)) {
    2072                 return status;
    2073         }
    2074 
    20752066        if (num_rids > 1000) {
    20762067                DEBUG(0, ("Got asked for %d rids (more than 1000) -- according "
     
    26232614                return NT_STATUS_INVALID_HANDLE;
    26242615
    2625         status = access_check_samr_function(info->acc_granted,
    2626                                             SAMR_USER_ACCESS_GET_ATTRIBUTES,
    2627                                             "_samr_QueryUserInfo");
    2628         if (!NT_STATUS_IS_OK(status)) {
    2629                 return status;
    2630         }
    2631 
    26322616        domain_sid = info->sid;
    26332617
     
    28902874        }
    28912875
    2892         status = access_check_samr_function(info->acc_granted,
    2893                                             SAMR_ACCESS_LOOKUP_DOMAIN,
    2894                                             "_samr_QueryDomainInfo" );
    2895 
    2896         if ( !NT_STATUS_IS_OK(status) )
    2897                 return status;
    2898 
    28992876        switch (r->in.level) {
    29002877                case 0x01:
     
    56385615        time_t u_logout;
    56395616        time_t u_lock_duration, u_reset_time;
    5640         NTSTATUS result;
    56415617
    56425618        DEBUG(5,("_samr_SetDomainInfo: %d\n", __LINE__));
     
    56455621        if (!find_policy_by_hnd(p, r->in.domain_handle, (void **)(void *)&info))
    56465622                return NT_STATUS_INVALID_HANDLE;
    5647 
    5648         /* We do have different access bits for info
    5649          * levels here, but we're really just looking for
    5650          * GENERIC_RIGHTS_DOMAIN_WRITE access. Unfortunately
    5651          * this maps to different specific bits. So
    5652          * assume if we have SAMR_DOMAIN_ACCESS_SET_INFO_1
    5653          * set we are ok. */
    5654 
    5655         result = access_check_samr_function(info->acc_granted,
    5656                                             SAMR_DOMAIN_ACCESS_SET_INFO_1,
    5657                                             "_samr_SetDomainInfo");
    5658 
    5659         if (!NT_STATUS_IS_OK(result))
    5660                 return result;
    56615623
    56625624        DEBUG(5,("_samr_SetDomainInfo: level: %d\n", r->in.level));
     
    57175679        uint32_t num_account = 0;
    57185680        struct samr_displayentry *entries = NULL;
    5719         NTSTATUS status;
    57205681
    57215682        DEBUG(5,("_samr_GetDisplayEnumerationIndex: %d\n", __LINE__));
     
    57245685        if (!find_policy_by_hnd(p, r->in.domain_handle, (void **)(void *)&info)) {
    57255686                return NT_STATUS_INVALID_HANDLE;
    5726         }
    5727 
    5728         status = access_check_samr_function(info->acc_granted,
    5729                                             SAMR_DOMAIN_ACCESS_ENUM_ACCOUNTS,
    5730                                             "_samr_GetDisplayEnumerationIndex");
    5731         if (!NT_STATUS_IS_OK(status)) {
    5732                 return status;
    57335687        }
    57345688
Note: See TracChangeset for help on using the changeset viewer.