]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Use pidl for _netr_LogonSamLogoff().
authorGünther Deschner <gd@samba.org>
Fri, 15 Feb 2008 20:46:42 +0000 (21:46 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 15 Feb 2008 20:52:19 +0000 (21:52 +0100)
Guenther

source/rpc_server/srv_netlog.c
source/rpc_server/srv_netlog_nt.c

index 719cdff41c2999d324df7dee3df8ee70480c1527..0e386c0de3021bec61b8e7f0de1324ed35aa456f 100644 (file)
@@ -91,28 +91,7 @@ static bool api_net_srv_pwset(pipes_struct *p)
 
 static bool api_net_sam_logoff(pipes_struct *p)
 {
-       NET_Q_SAM_LOGOFF q_u;
-       NET_R_SAM_LOGOFF 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(!net_io_q_sam_logoff("", &q_u, data, 0)) {
-               DEBUG(0,("api_net_sam_logoff: Failed to unmarshall NET_Q_SAM_LOGOFF.\n"));
-               return False;
-       }
-
-       r_u.status = _net_sam_logoff(p, &q_u, &r_u);
-
-       /* store the response in the SMB stream */
-       if(!net_io_r_sam_logoff("", &r_u, rdata, 0)) {
-               DEBUG(0,("api_net_sam_logoff: Failed to marshall NET_R_SAM_LOGOFF.\n"));
-               return False;
-       }
-
-       return True;
+       return proxy_netr_call(p, NDR_NETR_LOGONSAMLOGOFF);
 }
 
 /*************************************************************************
index c11ada2461f3519b96f06fc7ae460959269af858..30066dc58fb9d62f72110a97fdc975b5525e276e 100644 (file)
@@ -682,18 +682,17 @@ NTSTATUS _netr_ServerPasswordSet(pipes_struct *p,
 }
 
 /*************************************************************************
- _net_sam_logoff:
+ _netr_LogonSamLogoff
  *************************************************************************/
 
-NTSTATUS _net_sam_logoff(pipes_struct *p, NET_Q_SAM_LOGOFF *q_u, NET_R_SAM_LOGOFF *r_u)
+NTSTATUS _netr_LogonSamLogoff(pipes_struct *p,
+                             struct netr_LogonSamLogoff *r)
 {
-       fstring remote_machine;
-
        if ( (lp_server_schannel() == True) && (p->auth.auth_type != PIPE_AUTH_TYPE_SCHANNEL) ) {
                /* 'server schannel = yes' should enforce use of
                   schannel, the client did offer it in auth2, but
                   obviously did not use it. */
-               DEBUG(0,("_net_sam_logoff: client %s not using schannel for netlogon\n",
+               DEBUG(0,("_netr_LogonSamLogoff: client %s not using schannel for netlogon\n",
                        get_remote_machine_name() ));
                return NT_STATUS_ACCESS_DENIED;
        }
@@ -702,9 +701,8 @@ NTSTATUS _net_sam_logoff(pipes_struct *p, NET_Q_SAM_LOGOFF *q_u, NET_R_SAM_LOGOF
        if (!get_valid_user_struct(p->vuid))
                return NT_STATUS_NO_SUCH_USER;
 
-       /* Get the remote machine name for the creds store. */
-       rpcstr_pull(remote_machine,q_u->sam_id.client.login.uni_comp_name.buffer,
-                   sizeof(remote_machine),q_u->sam_id.client.login.uni_comp_name.uni_str_len*2,0);
+       /* Using the remote machine name for the creds store: */
+       /* r->in.computer_name */
 
        if (!p->dc) {
                /* Restore the saved state of the netlogon creds. */
@@ -712,8 +710,8 @@ NTSTATUS _net_sam_logoff(pipes_struct *p, NET_Q_SAM_LOGOFF *q_u, NET_R_SAM_LOGOF
 
                become_root();
                ret = secrets_restore_schannel_session_info(p->pipe_state_mem_ctx,
-                                               remote_machine,
-                                               &p->dc);
+                                                           r->in.computer_name,
+                                                           &p->dc);
                unbecome_root();
                if (!ret) {
                        return NT_STATUS_INVALID_HANDLE;
@@ -724,25 +722,22 @@ NTSTATUS _net_sam_logoff(pipes_struct *p, NET_Q_SAM_LOGOFF *q_u, NET_R_SAM_LOGOF
                return NT_STATUS_INVALID_HANDLE;
        }
 
-       r_u->buffer_creds = 1; /* yes, we have valid server credentials */
-
        /* checks and updates credentials.  creates reply credentials */
-       if (!creds_server_step(p->dc, &q_u->sam_id.client.cred, &r_u->srv_creds)) {
-               DEBUG(2,("_net_sam_logoff: creds_server_step failed. Rejecting auth "
+       if (!netlogon_creds_server_step(p->dc, r->in.credential, r->out.return_authenticator)) {
+               DEBUG(2,("_netr_LogonSamLogoff: netlogon_creds_server_step failed. Rejecting auth "
                        "request from client %s machine account %s\n",
-                       remote_machine, p->dc->mach_acct ));
+                       r->in.computer_name, p->dc->mach_acct ));
                return NT_STATUS_INVALID_PARAMETER;
        }
 
        /* We must store the creds state after an update. */
        become_root();
        secrets_store_schannel_session_info(p->pipe_state_mem_ctx,
-                                       remote_machine,
-                                       p->dc);
+                                           r->in.computer_name,
+                                           p->dc);
        unbecome_root();
 
-       r_u->status = NT_STATUS_OK;
-       return r_u->status;
+       return NT_STATUS_OK;
 }
 
 /*******************************************************************
@@ -1231,16 +1226,6 @@ NTSTATUS _netr_LogonSamLogon(pipes_struct *p,
 /****************************************************************
 ****************************************************************/
 
-NTSTATUS _netr_LogonSamLogoff(pipes_struct *p,
-                             struct netr_LogonSamLogoff *r)
-{
-       p->rng_fault_state = true;
-       return NT_STATUS_NOT_IMPLEMENTED;
-}
-
-/****************************************************************
-****************************************************************/
-
 NTSTATUS _netr_DatabaseDeltas(pipes_struct *p,
                              struct netr_DatabaseDeltas *r)
 {