Changeset 274 for branches/samba-3.3.x/source/rpc_server
- Timestamp:
- Jun 17, 2009, 2:19:52 PM (16 years ago)
- 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 473 473 NTSTATUS status; 474 474 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; 475 478 struct netr_Credential srv_chal_out; 476 479 … … 478 481 * Windows 7 looks at the negotiate_flags 479 482 * returned in this structure *even if the 480 * call fails with access denied ! So in order483 * call fails with access denied* ! So in order 481 484 * to allow Win7 to connect to a Samba NT style 482 485 * PDC we set the flags before we know if it's … … 495 498 NETLOGON_NEG_PASSWORD_CHANGE_REFUSAL; 496 499 500 /* Ensure we support strong (128-bit) keys. */ 501 if (in_neg_flags & NETLOGON_NEG_128BIT) { 502 srv_flgs |= NETLOGON_NEG_128BIT; 503 } 504 497 505 if (lp_server_schannel() != false) { 498 506 srv_flgs |= NETLOGON_NEG_SCHANNEL; 499 507 } 500 501 *r->out.negotiate_flags = srv_flgs;502 508 503 509 /* We use this as the key to store the creds: */ … … 507 513 DEBUG(0,("_netr_ServerAuthenticate2: no challenge sent to client %s\n", 508 514 r->in.computer_name)); 509 return NT_STATUS_ACCESS_DENIED; 515 status = NT_STATUS_ACCESS_DENIED; 516 goto out; 510 517 } 511 518 512 519 if ( (lp_server_schannel() == true) && 513 (( *r->in.negotiate_flags & NETLOGON_NEG_SCHANNEL) == 0) ) {520 ((in_neg_flags & NETLOGON_NEG_SCHANNEL) == 0) ) { 514 521 515 522 /* schannel must be used, but client did not offer it. */ … … 517 524 "to offer it. Client was %s\n", 518 525 r->in.account_name)); 519 return NT_STATUS_ACCESS_DENIED; 526 status = NT_STATUS_ACCESS_DENIED; 527 goto out; 520 528 } 521 529 … … 528 536 r->in.account_name, nt_errstr(status) )); 529 537 /* always return NT_STATUS_ACCESS_DENIED */ 530 return NT_STATUS_ACCESS_DENIED; 538 status = NT_STATUS_ACCESS_DENIED; 539 goto out; 531 540 } 532 541 533 542 /* 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, 535 544 p->dc, 536 545 &p->dc->clnt_chal, /* Stored client chal. */ … … 545 554 r->in.computer_name, 546 555 r->in.account_name)); 547 return NT_STATUS_ACCESS_DENIED; 556 status = NT_STATUS_ACCESS_DENIED; 557 goto out; 548 558 } 549 559 /* set up the LSA AUTH 2 response */ … … 563 573 p->dc); 564 574 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; 567 581 } 568 582 -
branches/samba-3.3.x/source/rpc_server/srv_samr_nt.c
r224 r274 863 863 sid_string_dbg(&pol_sid))); 864 864 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 872 865 /* Check what typ of SID is beeing queried (e.g Domain SID, User SID, Group SID) */ 873 866 … … 1166 1159 num_groups, groups); 1167 1160 1161 if (MAX_SAM_ENTRIES <= num_groups) { 1162 status = STATUS_MORE_ENTRIES; 1163 } else { 1164 status = NT_STATUS_OK; 1165 } 1166 1168 1167 samr_array->count = num_groups; 1169 1168 samr_array->entries = samr_entries; … … 1234 1233 DEBUG(5,("_samr_EnumDomainAliases: %d\n", __LINE__)); 1235 1234 1235 if (MAX_SAM_ENTRIES <= num_aliases) { 1236 status = STATUS_MORE_ENTRIES; 1237 } else { 1238 status = NT_STATUS_OK; 1239 } 1240 1236 1241 samr_array->count = num_aliases; 1237 1242 samr_array->entries = samr_entries; … … 1475 1480 DEBUG(5,("_samr_QueryDisplayInfo: Nothing in BUILTIN\n")); 1476 1481 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;1484 1482 } 1485 1483 … … 2066 2064 return NT_STATUS_INVALID_HANDLE; 2067 2065 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 2075 2066 if (num_rids > 1000) { 2076 2067 DEBUG(0, ("Got asked for %d rids (more than 1000) -- according " … … 2623 2614 return NT_STATUS_INVALID_HANDLE; 2624 2615 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 2632 2616 domain_sid = info->sid; 2633 2617 … … 2890 2874 } 2891 2875 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 2899 2876 switch (r->in.level) { 2900 2877 case 0x01: … … 5638 5615 time_t u_logout; 5639 5616 time_t u_lock_duration, u_reset_time; 5640 NTSTATUS result;5641 5617 5642 5618 DEBUG(5,("_samr_SetDomainInfo: %d\n", __LINE__)); … … 5645 5621 if (!find_policy_by_hnd(p, r->in.domain_handle, (void **)(void *)&info)) 5646 5622 return NT_STATUS_INVALID_HANDLE; 5647 5648 /* We do have different access bits for info5649 * levels here, but we're really just looking for5650 * GENERIC_RIGHTS_DOMAIN_WRITE access. Unfortunately5651 * this maps to different specific bits. So5652 * assume if we have SAMR_DOMAIN_ACCESS_SET_INFO_15653 * 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;5661 5623 5662 5624 DEBUG(5,("_samr_SetDomainInfo: level: %d\n", r->in.level)); … … 5717 5679 uint32_t num_account = 0; 5718 5680 struct samr_displayentry *entries = NULL; 5719 NTSTATUS status;5720 5681 5721 5682 DEBUG(5,("_samr_GetDisplayEnumerationIndex: %d\n", __LINE__)); … … 5724 5685 if (!find_policy_by_hnd(p, r->in.domain_handle, (void **)(void *)&info)) { 5725 5686 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;5733 5687 } 5734 5688
Note:
See TracChangeset
for help on using the changeset viewer.