Use pidl for _samr_OpenUser().
authorGünther Deschner <gd@samba.org>
Thu, 31 Jan 2008 23:39:06 +0000 (00:39 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 1 Feb 2008 08:57:10 +0000 (09:57 +0100)
Guenther
(This used to be commit ea3a096bcdc42fd4a86be5df3e8f9745e99970ff)

source3/rpc_server/srv_samr.c
source3/rpc_server/srv_samr_nt.c

index 9319d422da486a37d6eed6fcf52d2ae7be23778c..0627a0739719bc28212bdd7ffe04c71f78d10ebe 100644 (file)
@@ -417,28 +417,7 @@ static bool api_samr_lookup_rids(pipes_struct *p)
 
 static bool api_samr_open_user(pipes_struct *p)
 {
-       SAMR_Q_OPEN_USER q_u;
-       SAMR_R_OPEN_USER 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(!samr_io_q_open_user("", &q_u, data, 0)) {
-               DEBUG(0,("api_samr_open_user: unable to unmarshall SAMR_Q_OPEN_USER.\n"));
-               return False;
-       }
-
-       r_u.status = _samr_open_user(p, &q_u, &r_u);
-
-       /* store the response in the SMB stream */
-       if(!samr_io_r_open_user("", &r_u, rdata, 0)) {
-               DEBUG(0,("api_samr_open_user: unable to marshall SAMR_R_OPEN_USER.\n"));
-               return False;
-       }
-
-       return True;
+       return proxy_samr_call(p, NDR_SAMR_OPENUSER);
 }
 
 /*******************************************************************
index 05c0cc69cf72534fd49d837e3866e32fcf4e0169..b677876270ca230f3f36276e0f234af3ec5b1899 100644 (file)
@@ -1766,33 +1766,32 @@ NTSTATUS _samr_lookup_rids(pipes_struct *p, SAMR_Q_LOOKUP_RIDS *q_u, SAMR_R_LOOK
 }
 
 /*******************************************************************
- _samr_open_user. Safe - gives out no passwd info.
- ********************************************************************/
+ _samr_OpenUser
+********************************************************************/
 
-NTSTATUS _samr_open_user(pipes_struct *p, SAMR_Q_OPEN_USER *q_u, SAMR_R_OPEN_USER *r_u)
+NTSTATUS _samr_OpenUser(pipes_struct *p,
+                       struct samr_OpenUser *r)
 {
        struct samu *sampass=NULL;
        DOM_SID sid;
-       POLICY_HND domain_pol = q_u->domain_pol;
-       POLICY_HND *user_pol = &r_u->user_pol;
+       POLICY_HND domain_pol = *r->in.domain_handle;
+       POLICY_HND *user_pol = r->out.user_handle;
        struct samr_info *info = NULL;
        SEC_DESC *psd = NULL;
        uint32    acc_granted;
-       uint32    des_access = q_u->access_mask;
+       uint32    des_access = r->in.access_mask;
        size_t    sd_size;
        bool ret;
        NTSTATUS nt_status;
        SE_PRIV se_rights;
 
-       r_u->status = NT_STATUS_OK;
-
        /* find the domain policy handle and get domain SID / access bits in the domain policy. */
        
        if ( !get_lsa_policy_samr_sid(p, &domain_pol, &sid, &acc_granted, NULL) )
                return NT_STATUS_INVALID_HANDLE;
        
        nt_status = access_check_samr_function( acc_granted, 
-               SA_RIGHT_DOMAIN_OPEN_ACCOUNT, "_samr_open_user" );
+               SA_RIGHT_DOMAIN_OPEN_ACCOUNT, "_samr_OpenUser" );
                
        if ( !NT_STATUS_IS_OK(nt_status) )
                return nt_status;
@@ -1803,7 +1802,7 @@ NTSTATUS _samr_open_user(pipes_struct *p, SAMR_Q_OPEN_USER *q_u, SAMR_R_OPEN_USE
 
        /* append the user's RID to it */
        
-       if (!sid_append_rid(&sid, q_u->user_rid))
+       if (!sid_append_rid(&sid, r->in.rid))
                return NT_STATUS_NO_SUCH_USER;
        
        /* check if access can be granted as requested by client. */
@@ -1816,7 +1815,7 @@ NTSTATUS _samr_open_user(pipes_struct *p, SAMR_Q_OPEN_USER *q_u, SAMR_R_OPEN_USE
        
        nt_status = access_check_samr_object(psd, p->pipe_user.nt_user_token, 
                &se_rights, GENERIC_RIGHTS_USER_WRITE, des_access, 
-               &acc_granted, "_samr_open_user");
+               &acc_granted, "_samr_OpenUser");
                
        if ( !NT_STATUS_IS_OK(nt_status) )
                return nt_status;
@@ -1841,7 +1840,7 @@ NTSTATUS _samr_open_user(pipes_struct *p, SAMR_Q_OPEN_USER *q_u, SAMR_R_OPEN_USE
        if (!create_policy_hnd(p, user_pol, free_samr_info, (void *)info))
                return NT_STATUS_OBJECT_NAME_NOT_FOUND;
 
-       return r_u->status;
+       return NT_STATUS_OK;
 }
 
 /*************************************************************************
@@ -5381,16 +5380,6 @@ NTSTATUS _samr_GetMembersInAlias(pipes_struct *p,
 /****************************************************************
 ****************************************************************/
 
-NTSTATUS _samr_OpenUser(pipes_struct *p,
-                       struct samr_OpenUser *r)
-{
-       p->rng_fault_state = true;
-       return NT_STATUS_NOT_IMPLEMENTED;
-}
-
-/****************************************************************
-****************************************************************/
-
 NTSTATUS _samr_DeleteUser(pipes_struct *p,
                          struct samr_DeleteUser *r)
 {