STEP02? accept smbXsrv_connection passing...
authorStefan Metzmacher <metze@samba.org>
Tue, 24 Jun 2014 17:39:53 +0000 (19:39 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 15 May 2015 09:46:51 +0000 (11:46 +0200)
source3/smbd/smbXsrv_client.c

index 49c72950fca607118180a6267ef5d81868c018b9..e76278310ae37bb6a876f4f624775146f6ca1830 100644 (file)
@@ -613,6 +613,7 @@ static void smbXsrv_client_connection_pass_loop(struct tevent_req *subreq)
                tevent_req_callback_data(subreq,
                struct smbXsrv_client);
        //struct smbXsrv_client_table *table = client->table;
+       struct smbXsrv_connection *xconn = NULL;
        int ret;
        struct messaging_rec *rec = NULL;
        struct smbXsrv_connection_passB pass_blob;
@@ -690,7 +691,19 @@ static void smbXsrv_client_connection_pass_loop(struct tevent_req *subreq)
        DEBUG(0,("%s:%s: got connection sockfd[%d]\n", __location__, __func__,
                 sock_fd));
        NDR_PRINT_DEBUG(smbXsrv_connection_passB, &pass_blob);
-       smb_panic(__location__);
+       status = smbd_add_connection(client, sock_fd, &xconn);
+       if (!NT_STATUS_IS_OK(status)) {
+               close(sock_fd);
+               sock_fd = -1;
+               DEBUG(0,("smbXsrv_client_connection_pass_loop: "
+                        "smbd_add_connection => \n", nt_errstr(status)));
+               NDR_PRINT_DEBUG(smbXsrv_connection_passB, &pass_blob);
+               goto next;
+       }
+
+       smbd_smb2_first_negprot(xconn, pass_info0->negotiate_request.data,
+                               pass_info0->negotiate_request.length);
+
 next:
        TALLOC_FREE(rec);