diff options
-rw-r--r-- | source3/rpc_server/srv_lsa.c | 25 | ||||
-rw-r--r-- | source3/rpc_server/srv_lsa_nt.c | 21 |
2 files changed, 10 insertions, 36 deletions
diff --git a/source3/rpc_server/srv_lsa.c b/source3/rpc_server/srv_lsa.c index fd5d81548c..5811d8535b 100644 --- a/source3/rpc_server/srv_lsa.c +++ b/source3/rpc_server/srv_lsa.c @@ -307,29 +307,7 @@ static bool api_lsa_unk_get_connuser(pipes_struct *p) 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); } /*************************************************************************** @@ -943,6 +921,7 @@ static int count_fns(void) return funcs; } + void lsa_get_pipe_fns( struct api_struct **fns, int *n_fns ) { *fns = api_lsa_cmds; diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c index 61b9d19fa1..c197f20bfe 100644 --- a/source3/rpc_server/srv_lsa_nt.c +++ b/source3/rpc_server/srv_lsa_nt.c @@ -1606,16 +1606,17 @@ NTSTATUS _lsa_unk_get_connuser(pipes_struct *p, LSA_Q_UNK_GET_CONNUSER *q_u, LSA } /*************************************************************************** - 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 */ @@ -1633,7 +1634,7 @@ NTSTATUS _lsa_create_account(pipes_struct *p, LSA_Q_CREATEACCOUNT *q_u, LSA_R_CR 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. */ @@ -1642,11 +1643,11 @@ NTSTATUS _lsa_create_account(pipes_struct *p, LSA_Q_CREATEACCOUNT *q_u, LSA_R_CR 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 ); @@ -2215,12 +2216,6 @@ NTSTATUS _lsa_ClearAuditLog(pipes_struct *p, struct lsa_ClearAuditLog *r) 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; |