smbd:process: use smbXsrv_client_create.
authorMichael Adam <obnox@samba.org>
Fri, 22 Jan 2016 12:13:44 +0000 (13:13 +0100)
committerMichael Adam <obnox@samba.org>
Tue, 26 Jan 2016 14:58:11 +0000 (15:58 +0100)
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/process.c

index 13f06c53e32eaaed2812b4c8d81e2e2d106b24dc..ee88b58a0c8a644f1bcbc198819f691a0c21e4d3 100644 (file)
@@ -3902,10 +3902,12 @@ void smbd_process(struct tevent_context *ev_ctx,
        const char *remaddr = NULL;
        int ret;
        NTSTATUS status;
+       struct timeval tv = timeval_current();
+       NTTIME now = timeval_to_nttime(&tv);
 
-       client = talloc_zero(ev_ctx, struct smbXsrv_client);
-       if (client == NULL) {
-               DEBUG(0,("talloc_zero(struct smbXsrv_client)\n"));
+       status = smbXsrv_client_create(ev_ctx, ev_ctx, msg_ctx, now, &client);
+       if (!NT_STATUS_IS_OK(status)) {
+               DBG_ERR("smbXsrv_client_create(): %s\n", nt_errstr(status));
                exit_server_cleanly("talloc_zero(struct smbXsrv_client).\n");
        }
 
@@ -3914,9 +3916,6 @@ void smbd_process(struct tevent_context *ev_ctx,
         */
        global_smbXsrv_client = client;
 
-       client->ev_ctx = ev_ctx;
-       client->msg_ctx = msg_ctx;
-
        sconn = talloc_zero(client, struct smbd_server_connection);
        if (sconn == NULL) {
                exit_server("failed to create smbd_server_connection");