static bool api_lsa_create_account(pipes_struct *p)
{
- LSA_Q_CREATEACCOUNT q_u;
- LSA_R_CREATEACCOUNT r_u;
-
- prs_struct *data = &p->in_data.data;
- prs_struct *rdata = &p->out_data.rdata;
-
- ZERO_STRUCT(q_u);
- ZERO_STRUCT(r_u);
-
- if(!lsa_io_q_create_account("", &q_u, data, 0)) {
- DEBUG(0,("api_lsa_create_account: failed to unmarshall LSA_Q_CREATEACCOUNT.\n"));
- return False;
- }
-
- r_u.status = _lsa_create_account(p, &q_u, &r_u);
-
- /* store the response in the SMB stream */
- if(!lsa_io_r_create_account("", &r_u, rdata, 0)) {
- DEBUG(0,("api_lsa_create_account: Failed to marshall LSA_R_CREATEACCOUNT.\n"));
- return False;
- }
-
- return True;
+ return proxy_lsa_call(p, NDR_LSA_CREATEACCOUNT);
}
/***************************************************************************
return funcs;
}
+
void lsa_get_pipe_fns( struct api_struct **fns, int *n_fns )
{
*fns = api_lsa_cmds;
}
/***************************************************************************
- Lsa Create Account
+ _lsa_CreateAccount
***************************************************************************/
-NTSTATUS _lsa_create_account(pipes_struct *p, LSA_Q_CREATEACCOUNT *q_u, LSA_R_CREATEACCOUNT *r_u)
+NTSTATUS _lsa_CreateAccount(pipes_struct *p,
+ struct lsa_CreateAccount *r)
{
struct lsa_info *handle;
struct lsa_info *info;
/* find the connection policy handle. */
- if (!find_policy_by_hnd(p, &q_u->pol, (void **)(void *)&handle))
+ if (!find_policy_by_hnd(p, r->in.handle, (void **)(void *)&handle))
return NT_STATUS_INVALID_HANDLE;
/* check if the user have enough rights */
if ( !nt_token_check_domain_rid( p->pipe_user.nt_user_token, DOMAIN_GROUP_RID_ADMINS ) )
return NT_STATUS_ACCESS_DENIED;
- if ( is_privileged_sid( &q_u->sid.sid ) )
+ if ( is_privileged_sid( r->in.sid ) )
return NT_STATUS_OBJECT_NAME_COLLISION;
/* associate the user/group SID with the (unique) handle. */
return NT_STATUS_NO_MEMORY;
ZERO_STRUCTP(info);
- info->sid = q_u->sid.sid;
- info->access = q_u->access;
+ info->sid = *r->in.sid;
+ info->access = r->in.access_mask;
/* get a (unique) handle. open a policy on it. */
- if (!create_policy_hnd(p, &r_u->pol, free_lsa_info, (void *)info))
+ if (!create_policy_hnd(p, *r->out.acct_handle, free_lsa_info, (void *)info))
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
return privilege_create_account( &info->sid );
return NT_STATUS_NOT_IMPLEMENTED;
}
-NTSTATUS _lsa_CreateAccount(pipes_struct *p, struct lsa_CreateAccount *r)
-{
- p->rng_fault_state = True;
- return NT_STATUS_NOT_IMPLEMENTED;
-}
-
NTSTATUS _lsa_EnumAccounts(pipes_struct *p, struct lsa_EnumAccounts *r)
{
p->rng_fault_state = True;