2 Unix SMB2 implementation.
4 Copyright (C) Andrew Tridgell 2005
5 Copyright (C) Stefan Metzmacher 2005
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "system/time.h"
23 #include "libcli/smb2/smb2.h"
24 #include "libcli/smb2/smb2_calls.h"
25 #include "smb_server/smb_server.h"
26 #include "smb_server/service_smb_proto.h"
27 #include "smb_server/smb2/smb2_server.h"
28 #include "smbd/service_stream.h"
29 #include "lib/stream/packet.h"
30 #include "ntvfs/ntvfs.h"
31 #include "param/param.h"
32 #include "auth/gensec/gensec.h"
33 #include "auth/auth.h"
36 /* fill in the bufinfo */
37 void smb2srv_setup_bufinfo(struct smb2srv_request
*req
)
39 req
->in
.bufinfo
.mem_ctx
= req
;
40 req
->in
.bufinfo
.flags
= BUFINFO_FLAG_UNICODE
| BUFINFO_FLAG_SMB2
;
41 req
->in
.bufinfo
.align_base
= req
->in
.buffer
;
42 if (req
->in
.dynamic
) {
43 req
->in
.bufinfo
.data
= req
->in
.dynamic
;
44 req
->in
.bufinfo
.data_size
= req
->in
.body_size
- req
->in
.body_fixed
;
46 req
->in
.bufinfo
.data
= NULL
;
47 req
->in
.bufinfo
.data_size
= 0;
51 static int smb2srv_request_destructor(struct smb2srv_request
*req
)
53 DLIST_REMOVE(req
->smb_conn
->requests2
.list
, req
);
54 if (req
->pending_id
) {
55 idr_remove(req
->smb_conn
->requests2
.idtree_req
, req
->pending_id
);
60 static int smb2srv_request_deny_destructor(struct smb2srv_request
*req
)
65 struct smb2srv_request
*smb2srv_init_request(struct smbsrv_connection
*smb_conn
)
67 struct smb2srv_request
*req
;
69 req
= talloc_zero(smb_conn
, struct smb2srv_request
);
70 if (!req
) return NULL
;
72 req
->smb_conn
= smb_conn
;
74 talloc_set_destructor(req
, smb2srv_request_destructor
);
79 NTSTATUS
smb2srv_setup_reply(struct smb2srv_request
*req
, uint16_t body_fixed_size
,
80 bool body_dynamic_present
, uint32_t body_dynamic_size
)
82 uint32_t flags
= SMB2_HDR_FLAG_REDIRECT
;
83 uint32_t pid
= IVAL(req
->in
.hdr
, SMB2_HDR_PID
);
84 uint32_t tid
= IVAL(req
->in
.hdr
, SMB2_HDR_TID
);
86 if (req
->pending_id
) {
87 flags
|= SMB2_HDR_FLAG_ASYNC
;
88 pid
= req
->pending_id
;
92 if (body_dynamic_present
) {
93 if (body_dynamic_size
== 0) {
94 body_dynamic_size
= 1;
97 body_dynamic_size
= 0;
100 req
->out
.size
= SMB2_HDR_BODY
+NBT_HDR_SIZE
+body_fixed_size
;
102 req
->out
.allocated
= req
->out
.size
+ body_dynamic_size
;
103 req
->out
.buffer
= talloc_array(req
, uint8_t,
105 NT_STATUS_HAVE_NO_MEMORY(req
->out
.buffer
);
107 req
->out
.hdr
= req
->out
.buffer
+ NBT_HDR_SIZE
;
108 req
->out
.body
= req
->out
.hdr
+ SMB2_HDR_BODY
;
109 req
->out
.body_fixed
= body_fixed_size
;
110 req
->out
.body_size
= body_fixed_size
;
111 req
->out
.dynamic
= (body_dynamic_size
? req
->out
.body
+ body_fixed_size
: NULL
);
113 SIVAL(req
->out
.hdr
, 0, SMB2_MAGIC
);
114 SSVAL(req
->out
.hdr
, SMB2_HDR_LENGTH
, SMB2_HDR_BODY
);
115 SSVAL(req
->out
.hdr
, SMB2_HDR_EPOCH
, 0);
116 SIVAL(req
->out
.hdr
, SMB2_HDR_STATUS
, NT_STATUS_V(req
->status
));
117 SSVAL(req
->out
.hdr
, SMB2_HDR_OPCODE
, SVAL(req
->in
.hdr
, SMB2_HDR_OPCODE
));
118 SSVAL(req
->out
.hdr
, SMB2_HDR_CREDIT
, 0x0001);
119 SIVAL(req
->out
.hdr
, SMB2_HDR_FLAGS
, flags
);
120 SIVAL(req
->out
.hdr
, SMB2_HDR_NEXT_COMMAND
, 0);
121 SBVAL(req
->out
.hdr
, SMB2_HDR_MESSAGE_ID
, req
->seqnum
);
122 SIVAL(req
->out
.hdr
, SMB2_HDR_PID
, pid
);
123 SIVAL(req
->out
.hdr
, SMB2_HDR_TID
, tid
);
124 SBVAL(req
->out
.hdr
, SMB2_HDR_SESSION_ID
, BVAL(req
->in
.hdr
, SMB2_HDR_SESSION_ID
));
125 memset(req
->out
.hdr
+SMB2_HDR_SIGNATURE
, 0, 16);
127 /* set the length of the fixed body part and +1 if there's a dynamic part also */
128 SSVAL(req
->out
.body
, 0, body_fixed_size
+ (body_dynamic_size
?1:0));
131 * if we have a dynamic part, make sure the first byte
132 * which is always be part of the packet is initialized
134 if (body_dynamic_size
) {
136 SCVAL(req
->out
.dynamic
, 0, 0);
142 static NTSTATUS
smb2srv_reply(struct smb2srv_request
*req
);
144 static void smb2srv_chain_reply(struct smb2srv_request
*p_req
)
147 struct smb2srv_request
*req
;
148 uint32_t chain_offset
;
149 uint32_t protocol_version
;
150 uint16_t buffer_code
;
151 uint32_t dynamic_size
;
153 uint32_t last_hdr_offset
;
155 last_hdr_offset
= p_req
->in
.hdr
- p_req
->in
.buffer
;
157 chain_offset
= p_req
->chain_offset
;
158 p_req
->chain_offset
= 0;
160 if (p_req
->in
.size
< (last_hdr_offset
+ chain_offset
+ SMB2_MIN_SIZE_NO_BODY
)) {
161 DEBUG(2,("Invalid SMB2 chained packet at offset 0x%X from last hdr 0x%X\n",
162 chain_offset
, last_hdr_offset
));
163 smbsrv_terminate_connection(p_req
->smb_conn
, "Invalid SMB2 chained packet");
167 protocol_version
= IVAL(p_req
->in
.buffer
, last_hdr_offset
+ chain_offset
);
168 if (protocol_version
!= SMB2_MAGIC
) {
169 DEBUG(2,("Invalid SMB chained packet: protocol prefix: 0x%08X\n",
171 smbsrv_terminate_connection(p_req
->smb_conn
, "NON-SMB2 chained packet");
175 req
= smb2srv_init_request(p_req
->smb_conn
);
177 smbsrv_terminate_connection(p_req
->smb_conn
, "SMB2 chained packet - no memory");
181 req
->in
.buffer
= talloc_steal(req
, p_req
->in
.buffer
);
182 req
->in
.size
= p_req
->in
.size
;
183 req
->request_time
= p_req
->request_time
;
184 req
->in
.allocated
= req
->in
.size
;
186 req
->in
.hdr
= req
->in
.buffer
+ last_hdr_offset
+ chain_offset
;
187 req
->in
.body
= req
->in
.hdr
+ SMB2_HDR_BODY
;
188 req
->in
.body_size
= req
->in
.size
- (last_hdr_offset
+ chain_offset
+ SMB2_HDR_BODY
);
189 req
->in
.dynamic
= NULL
;
191 req
->seqnum
= BVAL(req
->in
.hdr
, SMB2_HDR_MESSAGE_ID
);
193 if (req
->in
.body_size
< 2) {
194 /* error handling for this is different for negprot to
195 other packet types */
196 uint16_t opcode
= SVAL(req
->in
.hdr
, SMB2_HDR_OPCODE
);
197 if (opcode
== SMB2_OP_NEGPROT
) {
198 smbsrv_terminate_connection(req
->smb_conn
, "Bad body size in SMB2 negprot");
200 smb2srv_send_error(req
, NT_STATUS_INVALID_PARAMETER
);
204 buffer_code
= SVAL(req
->in
.body
, 0);
205 req
->in
.body_fixed
= (buffer_code
& ~1);
206 dynamic_size
= req
->in
.body_size
- req
->in
.body_fixed
;
208 if (dynamic_size
!= 0 && (buffer_code
& 1)) {
209 req
->in
.dynamic
= req
->in
.body
+ req
->in
.body_fixed
;
210 if (smb2_oob(&req
->in
, req
->in
.dynamic
, dynamic_size
)) {
211 DEBUG(1,("SMB2 chained request invalid dynamic size 0x%x\n",
213 smb2srv_send_error(req
, NT_STATUS_INVALID_PARAMETER
);
218 smb2srv_setup_bufinfo(req
);
220 flags
= IVAL(req
->in
.hdr
, SMB2_HDR_FLAGS
);
221 if (flags
& SMB2_HDR_FLAG_CHAINED
) {
222 if (p_req
->chained_file_handle
) {
223 memcpy(req
->_chained_file_handle
,
224 p_req
->_chained_file_handle
,
225 sizeof(req
->_chained_file_handle
));
226 req
->chained_file_handle
= req
->_chained_file_handle
;
228 req
->chain_status
= p_req
->chain_status
;
232 * TODO: - make sure the length field is 64
233 * - make sure it's a request
236 status
= smb2srv_reply(req
);
237 if (!NT_STATUS_IS_OK(status
)) {
238 smbsrv_terminate_connection(req
->smb_conn
, nt_errstr(status
));
244 void smb2srv_send_reply(struct smb2srv_request
*req
)
249 if (req
->smb_conn
->connection
->event
.fde
== NULL
) {
250 /* the socket has been destroyed - no point trying to send a reply! */
255 if (req
->out
.size
> NBT_HDR_SIZE
) {
256 _smb2_setlen(req
->out
.buffer
, req
->out
.size
- NBT_HDR_SIZE
);
259 /* if signing is active on the session then sign the packet */
260 if (req
->is_signed
) {
261 status
= smb2_sign_message(&req
->out
,
262 req
->session
->session_info
->session_key
);
263 if (!NT_STATUS_IS_OK(status
)) {
264 smbsrv_terminate_connection(req
->smb_conn
, nt_errstr(status
));
270 blob
= data_blob_const(req
->out
.buffer
, req
->out
.size
);
271 status
= packet_send(req
->smb_conn
->packet
, blob
);
272 if (!NT_STATUS_IS_OK(status
)) {
273 smbsrv_terminate_connection(req
->smb_conn
, nt_errstr(status
));
275 if (req
->chain_offset
) {
276 smb2srv_chain_reply(req
);
282 void smb2srv_send_error(struct smb2srv_request
*req
, NTSTATUS error
)
286 if (req
->smb_conn
->connection
->event
.fde
== NULL
) {
287 /* the socket has been destroyed - no point trying to send an error! */
292 status
= smb2srv_setup_reply(req
, 8, true, 0);
293 if (!NT_STATUS_IS_OK(status
)) {
294 smbsrv_terminate_connection(req
->smb_conn
, nt_errstr(status
));
299 SIVAL(req
->out
.hdr
, SMB2_HDR_STATUS
, NT_STATUS_V(error
));
301 SSVAL(req
->out
.body
, 0x02, 0);
302 SIVAL(req
->out
.body
, 0x04, 0);
304 req
->chain_status
= NT_STATUS_INVALID_PARAMETER
;
306 smb2srv_send_reply(req
);
309 static NTSTATUS
smb2srv_reply(struct smb2srv_request
*req
)
316 if (SVAL(req
->in
.hdr
, SMB2_HDR_LENGTH
) != SMB2_HDR_BODY
) {
317 smbsrv_terminate_connection(req
->smb_conn
, "Invalid SMB2 header length");
318 return NT_STATUS_INVALID_PARAMETER
;
320 opcode
= SVAL(req
->in
.hdr
, SMB2_HDR_OPCODE
);
321 req
->chain_offset
= IVAL(req
->in
.hdr
, SMB2_HDR_NEXT_COMMAND
);
322 req
->seqnum
= BVAL(req
->in
.hdr
, SMB2_HDR_MESSAGE_ID
);
323 tid
= IVAL(req
->in
.hdr
, SMB2_HDR_TID
);
324 uid
= BVAL(req
->in
.hdr
, SMB2_HDR_SESSION_ID
);
325 flags
= IVAL(req
->in
.hdr
, SMB2_HDR_FLAGS
);
327 if (req
->smb_conn
->highest_smb2_seqnum
!= 0 &&
328 req
->seqnum
<= req
->smb_conn
->highest_smb2_seqnum
) {
329 smbsrv_terminate_connection(req
->smb_conn
, "Invalid SMB2 sequence number");
330 return NT_STATUS_INVALID_PARAMETER
;
332 req
->smb_conn
->highest_smb2_seqnum
= req
->seqnum
;
334 req
->session
= smbsrv_session_find(req
->smb_conn
, uid
, req
->request_time
);
335 req
->tcon
= smbsrv_smb2_tcon_find(req
->session
, tid
, req
->request_time
);
339 /* supporting signing is mandatory in SMB2, and is per-packet. So we
340 should check the signature on any incoming packet that is signed, and
341 should give a signed reply to any signed request */
342 if (flags
& SMB2_HDR_FLAG_SIGNED
) {
345 if (!req
->session
) goto nosession
;
347 req
->is_signed
= true;
348 status
= smb2_check_signature(&req
->in
,
349 req
->session
->session_info
->session_key
);
350 if (!NT_STATUS_IS_OK(status
)) {
351 smb2srv_send_error(req
, status
);
354 } else if (req
->session
&& req
->session
->smb2_signing
.active
) {
355 /* we require signing and this request was not signed */
356 smb2srv_send_error(req
, NT_STATUS_ACCESS_DENIED
);
360 if (!NT_STATUS_IS_OK(req
->chain_status
)) {
361 smb2srv_send_error(req
, req
->chain_status
);
366 case SMB2_OP_NEGPROT
:
367 smb2srv_negprot_recv(req
);
369 case SMB2_OP_SESSSETUP
:
370 smb2srv_sesssetup_recv(req
);
373 if (!req
->session
) goto nosession
;
374 smb2srv_logoff_recv(req
);
377 if (!req
->session
) goto nosession
;
378 smb2srv_tcon_recv(req
);
381 if (!req
->session
) goto nosession
;
382 if (!req
->tcon
) goto notcon
;
383 smb2srv_tdis_recv(req
);
386 if (!req
->session
) goto nosession
;
387 if (!req
->tcon
) goto notcon
;
388 smb2srv_create_recv(req
);
391 if (!req
->session
) goto nosession
;
392 if (!req
->tcon
) goto notcon
;
393 smb2srv_close_recv(req
);
396 if (!req
->session
) goto nosession
;
397 if (!req
->tcon
) goto notcon
;
398 smb2srv_flush_recv(req
);
401 if (!req
->session
) goto nosession
;
402 if (!req
->tcon
) goto notcon
;
403 smb2srv_read_recv(req
);
406 if (!req
->session
) goto nosession
;
407 if (!req
->tcon
) goto notcon
;
408 smb2srv_write_recv(req
);
411 if (!req
->session
) goto nosession
;
412 if (!req
->tcon
) goto notcon
;
413 smb2srv_lock_recv(req
);
416 if (!req
->session
) goto nosession
;
417 if (!req
->tcon
) goto notcon
;
418 smb2srv_ioctl_recv(req
);
421 smb2srv_cancel_recv(req
);
423 case SMB2_OP_KEEPALIVE
:
424 smb2srv_keepalive_recv(req
);
427 if (!req
->session
) goto nosession
;
428 if (!req
->tcon
) goto notcon
;
429 smb2srv_find_recv(req
);
432 if (!req
->session
) goto nosession
;
433 if (!req
->tcon
) goto notcon
;
434 smb2srv_notify_recv(req
);
436 case SMB2_OP_GETINFO
:
437 if (!req
->session
) goto nosession
;
438 if (!req
->tcon
) goto notcon
;
439 smb2srv_getinfo_recv(req
);
441 case SMB2_OP_SETINFO
:
442 if (!req
->session
) goto nosession
;
443 if (!req
->tcon
) goto notcon
;
444 smb2srv_setinfo_recv(req
);
447 if (!req
->session
) goto nosession
;
448 if (!req
->tcon
) goto notcon
;
449 smb2srv_break_recv(req
);
453 DEBUG(1,("Invalid SMB2 opcode: 0x%04X\n", opcode
));
454 smbsrv_terminate_connection(req
->smb_conn
, "Invalid SMB2 opcode");
458 smb2srv_send_error(req
, NT_STATUS_USER_SESSION_DELETED
);
461 smb2srv_send_error(req
, NT_STATUS_NETWORK_NAME_DELETED
);
465 NTSTATUS
smbsrv_recv_smb2_request(void *private_data
, DATA_BLOB blob
)
467 struct smbsrv_connection
*smb_conn
= talloc_get_type(private_data
, struct smbsrv_connection
);
468 struct smb2srv_request
*req
;
469 struct timeval cur_time
= timeval_current();
470 uint32_t protocol_version
;
471 uint16_t buffer_code
;
472 uint32_t dynamic_size
;
475 smb_conn
->statistics
.last_request_time
= cur_time
;
477 /* see if its a special NBT packet */
478 if (CVAL(blob
.data
,0) != 0) {
479 DEBUG(2,("Special NBT packet on SMB2 connection"));
480 smbsrv_terminate_connection(smb_conn
, "Special NBT packet on SMB2 connection");
484 if (blob
.length
< (NBT_HDR_SIZE
+ SMB2_MIN_SIZE_NO_BODY
)) {
485 DEBUG(2,("Invalid SMB2 packet length count %ld\n", (long)blob
.length
));
486 smbsrv_terminate_connection(smb_conn
, "Invalid SMB2 packet");
490 protocol_version
= IVAL(blob
.data
, NBT_HDR_SIZE
);
491 if (protocol_version
!= SMB2_MAGIC
) {
492 DEBUG(2,("Invalid SMB packet: protocol prefix: 0x%08X\n",
494 smbsrv_terminate_connection(smb_conn
, "NON-SMB2 packet");
498 req
= smb2srv_init_request(smb_conn
);
499 NT_STATUS_HAVE_NO_MEMORY(req
);
501 req
->in
.buffer
= talloc_steal(req
, blob
.data
);
502 req
->in
.size
= blob
.length
;
503 req
->request_time
= cur_time
;
504 req
->in
.allocated
= req
->in
.size
;
506 req
->in
.hdr
= req
->in
.buffer
+ NBT_HDR_SIZE
;
507 req
->in
.body
= req
->in
.hdr
+ SMB2_HDR_BODY
;
508 req
->in
.body_size
= req
->in
.size
- (SMB2_HDR_BODY
+NBT_HDR_SIZE
);
509 req
->in
.dynamic
= NULL
;
511 req
->seqnum
= BVAL(req
->in
.hdr
, SMB2_HDR_MESSAGE_ID
);
513 if (req
->in
.body_size
< 2) {
514 /* error handling for this is different for negprot to
515 other packet types */
516 uint16_t opcode
= SVAL(req
->in
.hdr
, SMB2_HDR_OPCODE
);
517 if (opcode
== SMB2_OP_NEGPROT
) {
518 smbsrv_terminate_connection(req
->smb_conn
, "Bad body size in SMB2 negprot");
521 smb2srv_send_error(req
, NT_STATUS_INVALID_PARAMETER
);
526 buffer_code
= SVAL(req
->in
.body
, 0);
527 req
->in
.body_fixed
= (buffer_code
& ~1);
528 dynamic_size
= req
->in
.body_size
- req
->in
.body_fixed
;
530 if (dynamic_size
!= 0 && (buffer_code
& 1)) {
531 req
->in
.dynamic
= req
->in
.body
+ req
->in
.body_fixed
;
532 if (smb2_oob(&req
->in
, req
->in
.dynamic
, dynamic_size
)) {
533 DEBUG(1,("SMB2 request invalid dynamic size 0x%x\n",
535 smb2srv_send_error(req
, NT_STATUS_INVALID_PARAMETER
);
540 smb2srv_setup_bufinfo(req
);
543 * TODO: - make sure the length field is 64
544 * - make sure it's a request
547 flags
= IVAL(req
->in
.hdr
, SMB2_HDR_FLAGS
);
548 /* the first request should never have the related flag set */
549 if (flags
& SMB2_HDR_FLAG_CHAINED
) {
550 req
->chain_status
= NT_STATUS_INVALID_PARAMETER
;
553 return smb2srv_reply(req
);
556 static NTSTATUS
smb2srv_init_pending(struct smbsrv_connection
*smb_conn
)
558 smb_conn
->requests2
.idtree_req
= idr_init(smb_conn
);
559 NT_STATUS_HAVE_NO_MEMORY(smb_conn
->requests2
.idtree_req
);
560 smb_conn
->requests2
.idtree_limit
= 0x00FFFFFF & (UINT32_MAX
- 1);
561 smb_conn
->requests2
.list
= NULL
;
566 NTSTATUS
smb2srv_queue_pending(struct smb2srv_request
*req
)
569 bool signing_used
= false;
572 if (req
->pending_id
) {
573 return NT_STATUS_INTERNAL_ERROR
;
576 id
= idr_get_new_above(req
->smb_conn
->requests2
.idtree_req
, req
,
577 1, req
->smb_conn
->requests2
.idtree_limit
);
579 return NT_STATUS_INSUFFICIENT_RESOURCES
;
582 DLIST_ADD_END(req
->smb_conn
->requests2
.list
, req
, struct smb2srv_request
*);
583 req
->pending_id
= id
;
585 if (req
->smb_conn
->connection
->event
.fde
== NULL
) {
586 /* the socket has been destroyed - no point trying to send an error! */
587 return NT_STATUS_REMOTE_DISCONNECT
;
590 talloc_set_destructor(req
, smb2srv_request_deny_destructor
);
592 status
= smb2srv_setup_reply(req
, 8, true, 0);
593 if (!NT_STATUS_IS_OK(status
)) {
597 SIVAL(req
->out
.hdr
, SMB2_HDR_STATUS
, NT_STATUS_V(STATUS_PENDING
));
599 SSVAL(req
->out
.body
, 0x02, 0);
600 SIVAL(req
->out
.body
, 0x04, 0);
602 /* if the real reply will be signed set the signed flags, but don't sign */
603 if (req
->is_signed
) {
604 SIVAL(req
->out
.hdr
, SMB2_HDR_FLAGS
, IVAL(req
->out
.hdr
, SMB2_HDR_FLAGS
) | SMB2_HDR_FLAG_SIGNED
);
605 signing_used
= req
->is_signed
;
606 req
->is_signed
= false;
609 smb2srv_send_reply(req
);
611 req
->is_signed
= signing_used
;
613 talloc_set_destructor(req
, smb2srv_request_destructor
);
617 void smb2srv_cancel_recv(struct smb2srv_request
*req
)
622 struct smb2srv_request
*r
;
624 if (!req
->session
) goto done
;
626 flags
= IVAL(req
->in
.hdr
, SMB2_HDR_FLAGS
);
627 pending_id
= IVAL(req
->in
.hdr
, SMB2_HDR_PID
);
629 if (!(flags
& SMB2_HDR_FLAG_ASYNC
)) {
630 /* TODO: what to do here? */
634 p
= idr_find(req
->smb_conn
->requests2
.idtree_req
, pending_id
);
637 r
= talloc_get_type(p
, struct smb2srv_request
);
640 if (!r
->ntvfs
) goto done
;
642 ntvfs_cancel(r
->ntvfs
);
645 /* we never generate a reply for a SMB2 Cancel */
650 * init the SMB2 protocol related stuff
652 NTSTATUS
smbsrv_init_smb2_connection(struct smbsrv_connection
*smb_conn
)
656 /* now initialise a few default values associated with this smb socket */
657 smb_conn
->negotiate
.max_send
= 0xFFFF;
659 /* this is the size that w2k uses, and it appears to be important for
661 smb_conn
->negotiate
.max_recv
= lp_max_xmit(smb_conn
->lp_ctx
);
663 smb_conn
->negotiate
.zone_offset
= get_time_zone(time(NULL
));
665 smb_conn
->config
.security
= SEC_USER
;
666 smb_conn
->config
.nt_status_support
= true;
668 status
= smbsrv_init_sessions(smb_conn
, UINT64_MAX
);
669 NT_STATUS_NOT_OK_RETURN(status
);
671 status
= smb2srv_init_pending(smb_conn
);
672 NT_STATUS_NOT_OK_RETURN(status
);