Use pidl for _lsa_CreateAccount().
authorGünther Deschner <gd@samba.org>
Wed, 6 Feb 2008 17:58:11 +0000 (18:58 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 8 Feb 2008 21:38:34 +0000 (22:38 +0100)
Guenther
(This used to be commit d71f56a293d67971c45ee44219752a55fb21f8be)

source3/rpc_server/srv_lsa.c
source3/rpc_server/srv_lsa_nt.c

index fd5d81548cabd92431cab66277ee221ba01bf275..5811d8535bacf50951f8528092693fb1294c81dd 100644 (file)
@@ -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;
index 61b9d19fa186b51cd0e13ec40be6ef149c9617a8..c197f20bfe491ae6c71356f3397925fb53081c4c 100644 (file)
@@ -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;