struct lsa_DomainInfo *entries;
int i;
NTSTATUS nt_status;
- bool ok;
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&info);
- if (!ok) {
+ info = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &nt_status);
+ if (!NT_STATUS_IS_OK(nt_status)) {
return NT_STATUS_INVALID_HANDLE;
}
struct dom_sid *sid = NULL;
union lsa_PolicyInformation *info = NULL;
uint32_t acc_required = 0;
- bool ok;
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&handle);
- if (!ok) {
+ handle = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
struct lsa_TranslatedName *names_out = NULL;
struct lsa_TranslatedName2 *names = NULL;
int i;
- bool ok;
if (p->transport != NCACN_NP && p->transport != NCALRPC) {
p->fault_state = DCERPC_FAULT_ACCESS_DENIED;
return NT_STATUS_INVALID_PARAMETER;
}
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&handle);
- if (!ok) {
+ handle = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
struct lsa_RefDomainList *domains = NULL;
struct lsa_TranslatedName2 *names = NULL;
bool check_policy = true;
- bool ok;
switch (p->opnum) {
case NDR_LSA_LOOKUPSIDS3:
}
if (check_policy) {
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&handle);
- if (!ok) {
+ handle = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
struct lsa_TranslatedSid *rids = NULL;
uint32_t mapped_count = 0;
int flags = 0;
- bool ok;
if (p->transport != NCACN_NP && p->transport != NCALRPC) {
p->fault_state = DCERPC_FAULT_ACCESS_DENIED;
rids = NULL;
}
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&handle);
- if (!ok) {
+ handle = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
status = NT_STATUS_INVALID_HANDLE;
goto done;
}
uint32_t mapped_count = 0;
int flags = 0;
bool check_policy = true;
- bool ok;
switch (p->opnum) {
case NDR_LSA_LOOKUPNAMES4:
if (check_policy) {
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&handle);
- if (!ok) {
+ handle = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
status = NT_STATUS_INVALID_HANDLE;
goto done;
}
NTSTATUS _lsa_Close(struct pipes_struct *p, struct lsa_Close *r)
{
- bool ok;
+ NTSTATUS status;
if (p->transport != NCACN_NP && p->transport != NCALRPC) {
p->fault_state = DCERPC_FAULT_ACCESS_DENIED;
return NT_STATUS_ACCESS_DENIED;
}
- ok = find_policy_by_hnd(p,
- r->in.handle,
- DCESRV_HANDLE_ANY,
- NULL);
- if (!ok) {
+ (void)find_policy_by_hnd(p,
+ r->in.handle,
+ DCESRV_HANDLE_ANY,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
NTSTATUS _lsa_OpenSecret(struct pipes_struct *p,
struct lsa_OpenSecret *r)
{
- struct lsa_info *handle;
struct security_descriptor *psd;
NTSTATUS status;
uint32_t acc_granted;
- bool ok;
- ok = find_policy_by_hnd(p,
+ (void)find_policy_by_hnd(p,
r->in.handle,
LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&handle);
- if (!ok) {
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
NTSTATUS _lsa_OpenTrustedDomain(struct pipes_struct *p,
struct lsa_OpenTrustedDomain *r)
{
- struct lsa_info *handle = NULL;
struct trustdom_info *info = NULL;
NTSTATUS status;
- bool ok;
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&handle);
- if (!ok) {
+ (void)find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
NTSTATUS _lsa_OpenTrustedDomainByName(struct pipes_struct *p,
struct lsa_OpenTrustedDomainByName *r)
{
- struct lsa_info *handle = NULL;
struct trustdom_info *info = NULL;
NTSTATUS status;
- bool ok;
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&handle);
- if (!ok) {
+ (void)find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
struct pdb_trusted_domain td;
struct trustDomainPasswords auth_struct;
DATA_BLOB auth_blob;
- bool ok;
if (!IS_DC) {
return NT_STATUS_NOT_SUPPORTED;
}
- ok = find_policy_by_hnd(p,
- r->in.policy_handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&policy);
- if (!ok) {
+ policy = find_policy_by_hnd(p,
+ r->in.policy_handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
NTSTATUS status;
struct lsa_info *handle;
struct pdb_trusted_domain *td;
- bool ok;
/* find the connection policy handle. */
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&handle);
- if (!ok) {
+ handle = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
union lsa_TrustedDomainInfo *info;
struct pdb_trusted_domain *td;
uint32_t acc_required;
- bool ok;
/* find the connection policy handle. */
- ok = find_policy_by_hnd(p,
- r->in.trustdom_handle,
- LSA_HANDLE_TRUST_TYPE,
- (void **)(void *)&handle);
- if (!ok) {
+ handle = find_policy_by_hnd(p,
+ r->in.trustdom_handle,
+ LSA_HANDLE_TRUST_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
uint32_t acc_granted;
struct security_descriptor *psd;
size_t sd_size;
- bool ok;
/* find the connection policy handle. */
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&handle);
- if (!ok) {
+ handle = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
DATA_BLOB *cleartext_blob_new_p = NULL;
DATA_BLOB *cleartext_blob_old_p = NULL;
DATA_BLOB session_key;
- bool ok;
- ok = find_policy_by_hnd(p,
- r->in.sec_handle,
- LSA_HANDLE_SECRET_TYPE,
- (void **)(void *)&info);
- if (!ok) {
+ info = find_policy_by_hnd(p,
+ r->in.sec_handle,
+ LSA_HANDLE_SECRET_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
DATA_BLOB session_key;
NTTIME nttime_new, nttime_old;
NTSTATUS status;
- bool ok;
- ok = find_policy_by_hnd(p,
- r->in.sec_handle,
- LSA_HANDLE_SECRET_TYPE,
- (void **)(void *)&info);
- if (!ok) {
+ info = find_policy_by_hnd(p,
+ r->in.sec_handle,
+ LSA_HANDLE_SECRET_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
{
NTSTATUS status;
struct lsa_info *info = NULL;
- bool ok;
- ok = find_policy_by_hnd(p,
- r->in.handle,
- DCESRV_HANDLE_ANY,
- (void **)(void *)&info);
- if (!ok) {
+ info = find_policy_by_hnd(p,
+ r->in.handle,
+ DCESRV_HANDLE_ANY,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
uint32_t enum_context = *r->in.resume_handle;
int num_privs = num_privileges_in_short_list();
struct lsa_PrivEntry *entries = NULL;
- bool ok;
+ NTSTATUS status;
/* remember that the enum_context starts at 0 and not 1 */
DEBUG(10,("_lsa_EnumPrivs: enum_context:%d total entries:%d\n",
enum_context, num_privs));
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&handle);
- if (!ok) {
+ handle = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
struct lsa_info *handle;
const char *description;
struct lsa_StringLarge *lsa_name;
- bool ok;
+ NTSTATUS status;
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&handle);
- if (!ok) {
+ handle = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
int i, j, num_entries;
NTSTATUS status;
struct lsa_SidPtr *sids = NULL;
- bool ok;
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&handle);
- if (!ok) {
+ handle = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
~(LSA_ACCOUNT_ADJUST_PRIVILEGES|
LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS|
SEC_STD_DELETE));
- bool ok;
/* find the connection policy handle. */
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&handle);
- if (!ok) {
+ handle = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
NTSTATUS _lsa_OpenAccount(struct pipes_struct *p,
struct lsa_OpenAccount *r)
{
- struct lsa_info *handle;
struct security_descriptor *psd = NULL;
size_t sd_size;
uint32_t des_access = r->in.access_mask;
LSA_ACCOUNT_ADJUST_SYSTEM_ACCESS|
SEC_STD_DELETE));
NTSTATUS status;
- bool ok;
/* find the connection policy handle. */
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&handle);
- if (!ok) {
+ (void)find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
PRIVILEGE_SET *privileges;
struct lsa_PrivilegeSet *priv_set = NULL;
struct dom_sid_buf buf;
- bool ok;
/* find the connection policy handle. */
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_ACCOUNT_TYPE,
- (void **)(void *)&info);
- if (!ok) {
+ info = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_ACCOUNT_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
struct lsa_info *info = NULL;
struct lsa_EnumPrivsAccount e;
struct lsa_PrivilegeSet *privset;
- bool ok;
/* find the connection policy handle. */
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_ACCOUNT_TYPE,
- (void **)(void *)&info);
- if (!ok) {
+ info = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_ACCOUNT_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
struct lsa_info *info=NULL;
NTSTATUS status;
GROUP_MAP *map;
- bool ok;
/* find the connection policy handle. */
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_ACCOUNT_TYPE,
- (void **)(void *)&info);
- if (!ok) {
+ info = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_ACCOUNT_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
{
struct lsa_info *info = NULL;
struct lsa_PrivilegeSet *set = NULL;
- bool ok;
+ NTSTATUS status;
/* find the connection policy handle. */
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_ACCOUNT_TYPE,
- (void **)(void *)&info);
- if (!ok) {
+ info = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_ACCOUNT_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
{
struct lsa_info *info = NULL;
struct lsa_PrivilegeSet *set = NULL;
- bool ok;
+ NTSTATUS status;
/* find the connection policy handle. */
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_ACCOUNT_TYPE,
- (void **)(void *)&info);
- if (!ok) {
+ info = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_ACCOUNT_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
struct lsa_info *info = NULL;
const char *name;
struct lsa_StringLarge *lsa_name;
- bool ok;
+ NTSTATUS status;
/* find the connection policy handle. */
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&info);
- if (!ok) {
+ info = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
struct security_descriptor *psd = NULL;
size_t sd_size = 0;
NTSTATUS status;
- bool ok;
/* find the connection policy handle. */
- ok = find_policy_by_hnd(p,
- r->in.handle,
- DCESRV_HANDLE_ANY,
- (void **)(void *)&handle);
- if (!ok) {
+ handle = find_policy_by_hnd(p,
+ r->in.handle,
+ DCESRV_HANDLE_ANY,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
NTSTATUS _lsa_AddAccountRights(struct pipes_struct *p,
struct lsa_AddAccountRights *r)
{
- struct lsa_info *info = NULL;
int i = 0;
uint32_t acc_granted = 0;
struct security_descriptor *psd = NULL;
size_t sd_size;
struct dom_sid sid;
NTSTATUS status;
- bool ok;
/* find the connection policy handle. */
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&info);
- if (!ok) {
+ (void)find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
NTSTATUS _lsa_RemoveAccountRights(struct pipes_struct *p,
struct lsa_RemoveAccountRights *r)
{
- struct lsa_info *info = NULL;
int i = 0;
struct security_descriptor *psd = NULL;
size_t sd_size;
const char *privname = NULL;
uint32_t acc_granted = 0;
NTSTATUS status;
- bool ok;
/* find the connection policy handle. */
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&info);
- if (!ok) {
+ (void)find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
struct lsa_info *info = NULL;
PRIVILEGE_SET *privileges;
struct dom_sid_buf buf;
- bool ok;
/* find the connection policy handle. */
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&info);
- if (!ok) {
+ info = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
{
struct lsa_info *info = NULL;
const char *name = NULL;
- bool ok;
+ NTSTATUS status;
/* find the connection policy handle. */
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&info);
- if (!ok) {
+ info = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
int num_sids = 0;
uint32_t i;
enum sec_privilege privilege;
- bool ok;
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&info);
- if (!ok) {
+ info = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
struct lsa_SetInformationTrustedDomain *r)
{
struct lsa_info *policy;
- bool ok;
+ NTSTATUS status;
- ok = find_policy_by_hnd(p,
- r->in.trustdom_handle,
- LSA_HANDLE_TRUST_TYPE,
- (void **)(void *)&policy);
- if (!ok) {
+ policy = find_policy_by_hnd(p,
+ r->in.trustdom_handle,
+ LSA_HANDLE_TRUST_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}
struct lsa_TrustDomainInfoInfoEx *entries;
int i;
NTSTATUS nt_status;
- bool ok;
/* bail out early if pdb backend is not capable of ex trusted domains,
* if we don't do that, the client might not call
return NT_STATUS_NOT_IMPLEMENTED;
}
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_POLICY_TYPE,
- (void **)(void *)&info);
- if (!ok) {
+ info = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_POLICY_TYPE,
+ struct lsa_info,
+ &nt_status);
+ if (!NT_STATUS_IS_OK(nt_status)) {
return NT_STATUS_INVALID_HANDLE;
}
struct lsa_ForestTrustCollisionInfo *c_info;
struct pdb_domain_info *dom_info;
enum ndr_err_code ndr_err;
- bool ok;
if (!IS_DC) {
return NT_STATUS_NOT_SUPPORTED;
}
- ok = find_policy_by_hnd(p,
- r->in.handle,
- LSA_HANDLE_TRUST_TYPE,
- (void **)(void *)&handle);
- if (!ok) {
+ handle = find_policy_by_hnd(p,
+ r->in.handle,
+ LSA_HANDLE_TRUST_TYPE,
+ struct lsa_info,
+ &status);
+ if (!NT_STATUS_IS_OK(status)) {
return NT_STATUS_INVALID_HANDLE;
}