Changeset 272 for branches/samba-3.2.x/source/rpc_server
- Timestamp:
- Jun 16, 2009, 5:52:30 PM (16 years ago)
- 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 1630 1630 return NT_STATUS_INVALID_HANDLE; 1631 1631 1632 if (!(info->access & LSA_POLICY_VIEW_LOCAL_INFORMATION))1633 return NT_STATUS_ACCESS_DENIED;1634 1635 1632 if ( !get_privileges_for_sids( &mask, &info->sid, 1 ) ) 1636 1633 return NT_STATUS_OBJECT_NAME_NOT_FOUND; … … 1692 1689 if (!find_policy_by_hnd(p, r->in.handle, (void **)(void *)&info)) 1693 1690 return NT_STATUS_INVALID_HANDLE; 1694 1695 if (!(info->access & LSA_POLICY_VIEW_LOCAL_INFORMATION))1696 return NT_STATUS_ACCESS_DENIED;1697 1691 1698 1692 if (!lookup_sid(p->mem_ctx, &info->sid, NULL, NULL, NULL)) … … 2098 2092 return NT_STATUS_INVALID_HANDLE; 2099 2093 2100 if (!(info->access & LSA_POLICY_VIEW_LOCAL_INFORMATION))2101 return NT_STATUS_ACCESS_DENIED;2102 2103 2094 /* according to an NT4 PDC, you can add privileges to SIDs even without 2104 2095 call_lsa_create_account() first. And you can use any arbitrary SID. */ … … 2142 2133 if (!find_policy_by_hnd(p, r->in.handle, (void **)(void *)&info)) 2143 2134 return NT_STATUS_INVALID_HANDLE; 2144 2145 if (!(info->access & LSA_POLICY_VIEW_LOCAL_INFORMATION))2146 return NT_STATUS_ACCESS_DENIED;2147 2135 2148 2136 name = r->in.name->string; -
branches/samba-3.2.x/source/rpc_server/srv_netlog_nt.c
r233 r272 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 … … 564 574 p->dc); 565 575 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; 568 582 } 569 583 -
branches/samba-3.2.x/source/rpc_server/srv_samr_nt.c
r235 r272 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; … … 1471 1476 if (!find_policy_by_hnd(p, r->in.domain_handle, (void **)(void *)&info)) 1472 1477 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 }1480 1478 1481 1479 /* … … 2121 2119 return NT_STATUS_INVALID_HANDLE; 2122 2120 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 2130 2121 if (num_rids > 1000) { 2131 2122 DEBUG(0, ("Got asked for %d rids (more than 1000) -- according " … … 2700 2691 return NT_STATUS_INVALID_HANDLE; 2701 2692 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 2709 2693 domain_sid = info->sid; 2710 2694 … … 2949 2933 return NT_STATUS_INVALID_HANDLE; 2950 2934 } 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;2958 2935 2959 2936 switch (r->in.level) { … … 5671 5648 time_t u_logout; 5672 5649 time_t u_lock_duration, u_reset_time; 5673 NTSTATUS result;5674 5650 5675 5651 DEBUG(5,("_samr_SetDomainInfo: %d\n", __LINE__)); … … 5678 5654 if (!find_policy_by_hnd(p, r->in.domain_handle, (void **)(void *)&info)) 5679 5655 return NT_STATUS_INVALID_HANDLE; 5680 5681 /* We do have different access bits for info5682 * levels here, but we're really just looking for5683 * GENERIC_RIGHTS_DOMAIN_WRITE access. Unfortunately5684 * this maps to different specific bits. So5685 * assume if we have SA_RIGHT_DOMAIN_SET_INFO_15686 * 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;5694 5656 5695 5657 DEBUG(5,("_samr_SetDomainInfo: level: %d\n", r->in.level)); … … 5750 5712 uint32_t num_account = 0; 5751 5713 struct samr_displayentry *entries = NULL; 5752 NTSTATUS status;5753 5714 5754 5715 DEBUG(5,("_samr_GetDisplayEnumerationIndex: %d\n", __LINE__)); … … 5757 5718 if (!find_policy_by_hnd(p, r->in.domain_handle, (void **)(void *)&info)) { 5758 5719 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;5766 5720 } 5767 5721
Note:
See TracChangeset
for help on using the changeset viewer.