Ignore:
Timestamp:
Jun 16, 2009, 5:52:30 PM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.2 to 3.2.12

Location:
branches/samba-3.2.x/source/rpc_server
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.2.x/source/rpc_server/srv_lsa_nt.c

    r235 r272  
    16301630                return NT_STATUS_INVALID_HANDLE;
    16311631
    1632         if (!(info->access & LSA_POLICY_VIEW_LOCAL_INFORMATION))
    1633                 return NT_STATUS_ACCESS_DENIED;
    1634 
    16351632        if ( !get_privileges_for_sids( &mask, &info->sid, 1 ) )
    16361633                return NT_STATUS_OBJECT_NAME_NOT_FOUND;
     
    16921689        if (!find_policy_by_hnd(p, r->in.handle, (void **)(void *)&info))
    16931690                return NT_STATUS_INVALID_HANDLE;
    1694 
    1695         if (!(info->access & LSA_POLICY_VIEW_LOCAL_INFORMATION))
    1696                 return NT_STATUS_ACCESS_DENIED;
    16971691
    16981692        if (!lookup_sid(p->mem_ctx, &info->sid, NULL, NULL, NULL))
     
    20982092                return NT_STATUS_INVALID_HANDLE;
    20992093
    2100         if (!(info->access & LSA_POLICY_VIEW_LOCAL_INFORMATION))
    2101                 return NT_STATUS_ACCESS_DENIED;
    2102 
    21032094        /* according to an NT4 PDC, you can add privileges to SIDs even without
    21042095           call_lsa_create_account() first.  And you can use any arbitrary SID. */
     
    21422133        if (!find_policy_by_hnd(p, r->in.handle, (void **)(void *)&info))
    21432134                return NT_STATUS_INVALID_HANDLE;
    2144 
    2145         if (!(info->access & LSA_POLICY_VIEW_LOCAL_INFORMATION))
    2146                 return NT_STATUS_ACCESS_DENIED;
    21472135
    21482136        name = r->in.name->string;
  • branches/samba-3.2.x/source/rpc_server/srv_netlog_nt.c

    r233 r272  
    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
     
    564574                                            p->dc);
    565575        unbecome_root();
    566 
    567         return NT_STATUS_OK;
     576        status = NT_STATUS_OK;
     577
     578  out:
     579
     580        *r->out.negotiate_flags = srv_flgs;
     581        return status;
    568582}
    569583
  • branches/samba-3.2.x/source/rpc_server/srv_samr_nt.c

    r235 r272  
    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;
     
    14711476        if (!find_policy_by_hnd(p, r->in.domain_handle, (void **)(void *)&info))
    14721477                return NT_STATUS_INVALID_HANDLE;
    1473 
    1474         status = access_check_samr_function(info->acc_granted,
    1475                                             SA_RIGHT_DOMAIN_ENUM_ACCOUNTS,
    1476                                             "_samr_QueryDisplayInfo");
    1477         if (!NT_STATUS_IS_OK(status)) {
    1478                 return status;
    1479         }
    14801478
    14811479        /*
     
    21212119                return NT_STATUS_INVALID_HANDLE;
    21222120
    2123         status = access_check_samr_function(acc_granted,
    2124                                             0, /* Don't know the acc_bits yet */
    2125                                             "_samr__LookupRids");
    2126         if (!NT_STATUS_IS_OK(status)) {
    2127                 return status;
    2128         }
    2129 
    21302121        if (num_rids > 1000) {
    21312122                DEBUG(0, ("Got asked for %d rids (more than 1000) -- according "
     
    27002691                return NT_STATUS_INVALID_HANDLE;
    27012692
    2702         status = access_check_samr_function(info->acc_granted,
    2703                                             SAMR_USER_ACCESS_GET_ATTRIBUTES,
    2704                                             "_samr_QueryUserInfo");
    2705         if (!NT_STATUS_IS_OK(status)) {
    2706                 return status;
    2707         }
    2708 
    27092693        domain_sid = info->sid;
    27102694
     
    29492933                return NT_STATUS_INVALID_HANDLE;
    29502934        }
    2951 
    2952         status = access_check_samr_function(info->acc_granted,
    2953                                             SA_RIGHT_SAM_LOOKUP_DOMAIN,
    2954                                             "_samr_QueryDomainInfo" );
    2955 
    2956         if ( !NT_STATUS_IS_OK(status) )
    2957                 return status;
    29582935
    29592936        switch (r->in.level) {
     
    56715648        time_t u_logout;
    56725649        time_t u_lock_duration, u_reset_time;
    5673         NTSTATUS result;
    56745650
    56755651        DEBUG(5,("_samr_SetDomainInfo: %d\n", __LINE__));
     
    56785654        if (!find_policy_by_hnd(p, r->in.domain_handle, (void **)(void *)&info))
    56795655                return NT_STATUS_INVALID_HANDLE;
    5680 
    5681         /* We do have different access bits for info
    5682          * levels here, but we're really just looking for
    5683          * GENERIC_RIGHTS_DOMAIN_WRITE access. Unfortunately
    5684          * this maps to different specific bits. So
    5685          * assume if we have SA_RIGHT_DOMAIN_SET_INFO_1
    5686          * set we are ok. */
    5687 
    5688         result = access_check_samr_function(info->acc_granted,
    5689                                             SA_RIGHT_DOMAIN_SET_INFO_1,
    5690                                             "_samr_SetDomainInfo");
    5691 
    5692         if (!NT_STATUS_IS_OK(result))
    5693                 return result;
    56945656
    56955657        DEBUG(5,("_samr_SetDomainInfo: level: %d\n", r->in.level));
     
    57505712        uint32_t num_account = 0;
    57515713        struct samr_displayentry *entries = NULL;
    5752         NTSTATUS status;
    57535714
    57545715        DEBUG(5,("_samr_GetDisplayEnumerationIndex: %d\n", __LINE__));
     
    57575718        if (!find_policy_by_hnd(p, r->in.domain_handle, (void **)(void *)&info)) {
    57585719                return NT_STATUS_INVALID_HANDLE;
    5759         }
    5760 
    5761         status = access_check_samr_function(info->acc_granted,
    5762                                             SA_RIGHT_DOMAIN_ENUM_ACCOUNTS,
    5763                                             "_samr_GetDisplayEnumerationIndex");
    5764         if (!NT_STATUS_IS_OK(status)) {
    5765                 return status;
    57665720        }
    57675721
Note: See TracChangeset for help on using the changeset viewer.