2 Unix SMB/CIFS implementation.
4 Copyright (C) Stefan Metzmacher 2014
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include "system/filesys.h"
23 #include "lib/util/server_id.h"
24 #include "smbd/smbd.h"
25 #include "smbd/globals.h"
26 #include "dbwrap/dbwrap.h"
27 #include "dbwrap/dbwrap_rbt.h"
28 #include "dbwrap/dbwrap_open.h"
29 #include "dbwrap/dbwrap_watch.h"
32 #include "auth/gensec/gensec.h"
33 #include "../lib/tsocket/tsocket.h"
34 #include "../libcli/security/security.h"
36 #include "lib/util/util_tdb.h"
37 #include "librpc/gen_ndr/ndr_smbXsrv.h"
39 #include "lib/util/tevent_ntstatus.h"
40 #include "lib/util/iov_buf.h"
42 struct smbXsrv_client_table
{
48 struct db_context
*db_ctx
;
52 static struct db_context
*smbXsrv_client_global_db_ctx
= NULL
;
54 NTSTATUS
smbXsrv_client_global_init(void)
56 const char *global_path
= NULL
;
57 struct db_context
*db_ctx
= NULL
;
59 if (smbXsrv_client_global_db_ctx
!= NULL
) {
64 * This contains secret information like client keys!
66 global_path
= lock_path(talloc_tos(), "smbXsrv_client_global.tdb");
67 if (global_path
== NULL
) {
68 return NT_STATUS_NO_MEMORY
;
71 db_ctx
= db_open(NULL
, global_path
,
75 TDB_INCOMPATIBLE_HASH
,
76 O_RDWR
| O_CREAT
, 0600,
82 status
= map_nt_error_from_unix_common(errno
);
87 smbXsrv_client_global_db_ctx
= db_ctx
;
94 * We need to store the keys in big endian so that dbwrap_rbt's memcmp
95 * has the same result as integer comparison between the uint32_t
98 * TODO: implement string based key
101 #define SMBXSRV_CLIENT_GLOBAL_TDB_KEY_SIZE 16
103 static TDB_DATA
smbXsrv_client_global_id_to_key(const struct GUID
*client_guid
,
106 TDB_DATA key
= { .dsize
= 0, };
110 status
= GUID_to_ndr_blob(client_guid
, talloc_tos(), &b
);
111 if (!NT_STATUS_IS_OK(status
)) {
114 memcpy(key_buf
, b
.data
, SMBXSRV_CLIENT_GLOBAL_TDB_KEY_SIZE
);
117 key
= make_tdb_data(key_buf
, SMBXSRV_CLIENT_GLOBAL_TDB_KEY_SIZE
);
122 static struct db_record
*smbXsrv_client_global_fetch_locked(
123 struct db_context
*db
,
124 const struct GUID
*client_guid
,
128 uint8_t key_buf
[SMBXSRV_CLIENT_GLOBAL_TDB_KEY_SIZE
];
129 struct db_record
*rec
= NULL
;
131 key
= smbXsrv_client_global_id_to_key(client_guid
, key_buf
);
133 rec
= dbwrap_fetch_locked(db
, mem_ctx
, key
);
136 struct GUID_txt_buf buf
;
137 DBG_DEBUG("Failed to lock guid [%s], key '%s'\n",
138 GUID_buf_string(client_guid
, &buf
),
139 hex_encode_talloc(talloc_tos(), key
.dptr
, key
.dsize
));
145 static NTSTATUS
smbXsrv_client_table_create(TALLOC_CTX
*mem_ctx
,
146 struct messaging_context
*msg_ctx
,
147 uint32_t max_clients
,
148 struct smbXsrv_client_table
**_table
)
150 struct smbXsrv_client_table
*table
;
153 if (max_clients
> 1) {
154 return NT_STATUS_INTERNAL_ERROR
;
157 table
= talloc_zero(mem_ctx
, struct smbXsrv_client_table
);
159 return NT_STATUS_NO_MEMORY
;
162 table
->local
.max_clients
= max_clients
;
164 status
= smbXsrv_client_global_init();
165 if (!NT_STATUS_IS_OK(status
)) {
170 table
->global
.db_ctx
= smbXsrv_client_global_db_ctx
;
176 static int smbXsrv_client_global_destructor(struct smbXsrv_client_global0
*global
)
181 static void smbXsrv_client_global_verify_record(struct db_record
*db_rec
,
185 struct smbXsrv_client_global0
**_g
)
190 struct smbXsrv_client_globalB global_blob
;
191 enum ndr_err_code ndr_err
;
192 struct smbXsrv_client_global0
*global
= NULL
;
194 TALLOC_CTX
*frame
= talloc_stackframe();
205 key
= dbwrap_record_get_key(db_rec
);
207 val
= dbwrap_record_get_value(db_rec
);
208 if (val
.dsize
== 0) {
217 blob
= data_blob_const(val
.dptr
, val
.dsize
);
219 ndr_err
= ndr_pull_struct_blob(&blob
, frame
, &global_blob
,
220 (ndr_pull_flags_fn_t
)ndr_pull_smbXsrv_client_globalB
);
221 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err
)) {
222 NTSTATUS status
= ndr_map_error2ntstatus(ndr_err
);
223 DBG_WARNING("smbXsrv_client_global_verify_record: "
224 "key '%s' ndr_pull_struct_blob - %s\n",
225 hex_encode_talloc(frame
, key
.dptr
, key
.dsize
),
231 DBG_DEBUG("client_global:\n");
232 if (DEBUGLVL(DBGLVL_DEBUG
)) {
233 NDR_PRINT_DEBUG(smbXsrv_client_globalB
, &global_blob
);
236 if (global_blob
.version
!= SMBXSRV_VERSION_0
) {
237 DBG_ERR("key '%s' use unsupported version %u\n",
238 hex_encode_talloc(frame
, key
.dptr
, key
.dsize
),
239 global_blob
.version
);
240 NDR_PRINT_DEBUG(smbXsrv_client_globalB
, &global_blob
);
245 global
= global_blob
.info
.info0
;
247 exists
= serverid_exists(&global
->server_id
);
249 struct server_id_buf tmp
;
251 DBG_NOTICE("key '%s' server_id %s does not exist.\n",
252 hex_encode_talloc(frame
, key
.dptr
, key
.dsize
),
253 server_id_str_buf(global
->server_id
, &tmp
));
254 if (DEBUGLVL(DBGLVL_NOTICE
)) {
255 NDR_PRINT_DEBUG(smbXsrv_client_globalB
, &global_blob
);
258 dbwrap_record_delete(db_rec
);
264 *_g
= talloc_move(mem_ctx
, &global
);
269 NTSTATUS
smb2srv_client_lookup_global(struct smbXsrv_client
*client
,
270 struct GUID client_guid
,
272 struct smbXsrv_client_global0
**_global
)
274 struct smbXsrv_client_table
*table
= client
->table
;
275 struct smbXsrv_client_global0
*global
= NULL
;
276 bool is_free
= false;
277 struct db_record
*db_rec
;
279 db_rec
= smbXsrv_client_global_fetch_locked(table
->global
.db_ctx
,
282 if (db_rec
== NULL
) {
283 return NT_STATUS_INTERNAL_DB_ERROR
;
286 smbXsrv_client_global_verify_record(db_rec
,
294 return NT_STATUS_OBJECTID_NOT_FOUND
;
297 if (global
== NULL
) {
299 * most likely ndr_pull_struct_blob() failed
301 return NT_STATUS_INTERNAL_DB_CORRUPTION
;
308 NTSTATUS
smb2srv_client_connection_pass(struct smbd_smb2_request
*smb2req
,
309 struct smbXsrv_client_global0
*global
)
312 enum ndr_err_code ndr_err
;
314 struct smbXsrv_connection_pass0 pass_info0
;
315 struct smbXsrv_connection_passB pass_blob
;
319 pass_info0
.initial_connect_time
= global
->initial_connect_time
;
320 pass_info0
.client_guid
= global
->client_guid
;
322 reqlen
= iov_buflen(smb2req
->in
.vector
, smb2req
->in
.vector_count
);
324 return NT_STATUS_INVALID_BUFFER_SIZE
;
327 pass_info0
.negotiate_request
.length
= reqlen
;
328 pass_info0
.negotiate_request
.data
= talloc_array(talloc_tos(), uint8_t,
330 if (pass_info0
.negotiate_request
.data
== NULL
) {
331 return NT_STATUS_NO_MEMORY
;
333 iov_buf(smb2req
->in
.vector
, smb2req
->in
.vector_count
,
334 pass_info0
.negotiate_request
.data
,
335 pass_info0
.negotiate_request
.length
);
337 ZERO_STRUCT(pass_blob
);
338 pass_blob
.version
= smbXsrv_version_global_current();
339 pass_blob
.info
.info0
= &pass_info0
;
341 if (DEBUGLVL(DBGLVL_DEBUG
)) {
342 NDR_PRINT_DEBUG(smbXsrv_connection_passB
, &pass_blob
);
345 ndr_err
= ndr_push_struct_blob(&blob
, talloc_tos(), &pass_blob
,
346 (ndr_push_flags_fn_t
)ndr_push_smbXsrv_connection_passB
);
347 data_blob_free(&pass_info0
.negotiate_request
);
348 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err
)) {
349 status
= ndr_map_error2ntstatus(ndr_err
);
353 iov
.iov_base
= blob
.data
;
354 iov
.iov_len
= blob
.length
;
356 status
= messaging_send_iov(smb2req
->xconn
->client
->msg_ctx
,
358 MSG_SMBXSRV_CONNECTION_PASS
,
360 &smb2req
->xconn
->transport
.sock
, 1);
361 data_blob_free(&blob
);
362 if (!NT_STATUS_IS_OK(status
)) {
369 static NTSTATUS
smbXsrv_client_global_store(struct smbXsrv_client_global0
*global
)
371 struct smbXsrv_client_globalB global_blob
;
372 DATA_BLOB blob
= data_blob_null
;
376 enum ndr_err_code ndr_err
;
377 bool saved_stored
= global
->stored
;
380 * TODO: if we use other versions than '0'
381 * we would add glue code here, that would be able to
382 * store the information in the old format.
385 SMB_ASSERT(global
->local_address
!= NULL
);
386 SMB_ASSERT(global
->remote_address
!= NULL
);
387 SMB_ASSERT(global
->remote_name
!= NULL
);
389 if (global
->db_rec
== NULL
) {
390 return NT_STATUS_INTERNAL_ERROR
;
393 key
= dbwrap_record_get_key(global
->db_rec
);
394 val
= dbwrap_record_get_value(global
->db_rec
);
396 ZERO_STRUCT(global_blob
);
397 global_blob
.version
= smbXsrv_version_global_current();
398 if (val
.dsize
>= 8) {
399 global_blob
.seqnum
= IVAL(val
.dptr
, 4);
401 global_blob
.seqnum
+= 1;
402 global_blob
.info
.info0
= global
;
404 global
->stored
= true;
405 ndr_err
= ndr_push_struct_blob(&blob
, global
->db_rec
, &global_blob
,
406 (ndr_push_flags_fn_t
)ndr_push_smbXsrv_client_globalB
);
407 global
->stored
= saved_stored
;
408 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err
)) {
409 status
= ndr_map_error2ntstatus(ndr_err
);
410 DBG_WARNING("key '%s' ndr_push - %s\n",
411 hex_encode_talloc(global
->db_rec
, key
.dptr
, key
.dsize
),
413 TALLOC_FREE(global
->db_rec
);
417 val
= make_tdb_data(blob
.data
, blob
.length
);
418 status
= dbwrap_record_store(global
->db_rec
, val
, TDB_REPLACE
);
419 if (!NT_STATUS_IS_OK(status
)) {
420 DBG_WARNING("key '%s' store - %s\n",
421 hex_encode_talloc(global
->db_rec
, key
.dptr
, key
.dsize
),
423 TALLOC_FREE(global
->db_rec
);
427 global
->stored
= true;
429 if (DEBUGLVL(DBGLVL_DEBUG
)) {
430 DBG_DEBUG("key '%s' stored\n",
431 hex_encode_talloc(global
->db_rec
, key
.dptr
, key
.dsize
));
432 NDR_PRINT_DEBUG(smbXsrv_client_globalB
, &global_blob
);
435 TALLOC_FREE(global
->db_rec
);
440 static NTSTATUS
smbXsrv_client_global_remove(struct smbXsrv_client_global0
*global
)
446 * TODO: if we use other versions than '0'
447 * we would add glue code here, that would be able to
448 * store the information in the old format.
451 if (global
->db_rec
== NULL
) {
452 return NT_STATUS_INTERNAL_ERROR
;
455 key
= dbwrap_record_get_key(global
->db_rec
);
457 status
= dbwrap_record_delete(global
->db_rec
);
458 if (!NT_STATUS_IS_OK(status
)) {
459 DBG_WARNING("key '%s' delete - %s\n",
460 hex_encode_talloc(global
->db_rec
, key
.dptr
, key
.dsize
),
462 TALLOC_FREE(global
->db_rec
);
465 global
->stored
= false;
466 DBG_DEBUG("key '%s' delete\n",
467 hex_encode_talloc(global
->db_rec
, key
.dptr
, key
.dsize
));
469 TALLOC_FREE(global
->db_rec
);
474 static int smbXsrv_client_destructor(struct smbXsrv_client
*client
)
478 status
= smbXsrv_client_remove(client
);
479 if (!NT_STATUS_IS_OK(status
)) {
480 DBG_ERR("smbXsrv_client_remove() failed: %s\n",
484 TALLOC_FREE(client
->global
);
489 static bool smbXsrv_client_connection_pass_filter(struct messaging_rec
*rec
, void *private_data
);
490 static void smbXsrv_client_connection_pass_loop(struct tevent_req
*subreq
);
492 NTSTATUS
smbXsrv_client_create(TALLOC_CTX
*mem_ctx
,
493 struct tevent_context
*ev_ctx
,
494 struct messaging_context
*msg_ctx
,
496 struct smbXsrv_client
**_client
)
498 struct smbXsrv_client_table
*table
;
499 struct smbXsrv_client
*client
= NULL
;
500 struct smbXsrv_client_global0
*global
= NULL
;
502 struct tevent_req
*subreq
= NULL
;
504 status
= smbXsrv_client_table_create(mem_ctx
,
508 if (!NT_STATUS_IS_OK(status
)) {
512 if (table
->local
.num_clients
>= table
->local
.max_clients
) {
514 return NT_STATUS_INSUFFICIENT_RESOURCES
;
517 client
= talloc_zero(mem_ctx
, struct smbXsrv_client
);
518 if (client
== NULL
) {
520 return NT_STATUS_NO_MEMORY
;
522 client
->raw_ev_ctx
= ev_ctx
;
523 client
->msg_ctx
= msg_ctx
;
525 client
->server_multi_channel_enabled
=
526 smbXsrv_server_multi_channel_enabled();
527 if (client
->server_multi_channel_enabled
) {
528 client
->next_channel_id
= 1;
530 client
->table
= talloc_move(client
, &table
);
531 table
= client
->table
;
533 global
= talloc_zero(client
, struct smbXsrv_client_global0
);
534 if (global
== NULL
) {
536 return NT_STATUS_NO_MEMORY
;
538 talloc_set_destructor(global
, smbXsrv_client_global_destructor
);
539 client
->global
= global
;
541 global
->initial_connect_time
= now
;
543 global
->server_id
= messaging_server_id(client
->msg_ctx
);
545 table
->local
.num_clients
+= 1;
547 talloc_set_destructor(client
, smbXsrv_client_destructor
);
549 if (DEBUGLVL(DBGLVL_DEBUG
)) {
550 struct smbXsrv_clientB client_blob
= {
551 .version
= SMBXSRV_VERSION_0
,
552 .info
.info0
= client
,
554 struct GUID_txt_buf buf
;
556 DBG_DEBUG("client_guid[%s] created\n",
557 GUID_buf_string(&global
->client_guid
, &buf
));
558 NDR_PRINT_DEBUG(smbXsrv_clientB
, &client_blob
);
561 subreq
= messaging_filtered_read_send(client
,
564 smbXsrv_client_connection_pass_filter
,
566 if (subreq
== NULL
) {
568 return NT_STATUS_NO_MEMORY
;
570 tevent_req_set_callback(subreq
, smbXsrv_client_connection_pass_loop
, client
);
576 static bool smbXsrv_client_connection_pass_filter(struct messaging_rec
*rec
, void *private_data
)
578 if (rec
->msg_type
!= MSG_SMBXSRV_CONNECTION_PASS
) {
582 if (rec
->num_fds
!= 1) {
586 if (rec
->buf
.length
< SMB2_HDR_BODY
) {
590 /* TODO: verify client_guid...? */
595 static void smbXsrv_client_connection_pass_loop(struct tevent_req
*subreq
)
597 struct smbXsrv_client
*client
=
598 tevent_req_callback_data(subreq
,
599 struct smbXsrv_client
);
600 struct smbXsrv_connection
*xconn
= NULL
;
602 struct messaging_rec
*rec
= NULL
;
603 struct smbXsrv_connection_passB pass_blob
;
604 enum ndr_err_code ndr_err
;
605 struct smbXsrv_connection_pass0
*pass_info0
= NULL
;
610 ret
= messaging_filtered_read_recv(subreq
, talloc_tos(), &rec
);
616 if (rec
->num_fds
!= 1) {
617 DBG_ERR("MSG_SMBXSRV_CONNECTION_PASS: num_fds[%u]\n",
622 sock_fd
= rec
->fds
[0];
623 DBG_DEBUG("MSG_SMBXSRV_CONNECTION_PASS: got sock_fd[%d]\n", sock_fd
);
625 ndr_err
= ndr_pull_struct_blob(&rec
->buf
, rec
, &pass_blob
,
626 (ndr_pull_flags_fn_t
)ndr_pull_smbXsrv_connection_passB
);
627 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err
)) {
628 status
= ndr_map_error2ntstatus(ndr_err
);
629 DBG_WARNING("ndr_pull_struct_blob - %s\n", nt_errstr(status
));
633 if (DEBUGLVL(DBGLVL_DEBUG
)) {
634 NDR_PRINT_DEBUG(smbXsrv_connection_passB
, &pass_blob
);
637 if (pass_blob
.version
!= SMBXSRV_VERSION_0
) {
638 DBG_ERR("ignore invalid version %u\n", pass_blob
.version
);
639 NDR_PRINT_DEBUG(smbXsrv_connection_passB
, &pass_blob
);
643 pass_info0
= pass_blob
.info
.info0
;
644 if (pass_info0
== NULL
) {
645 DBG_ERR("ignore NULL info %u\n", pass_blob
.version
);
646 NDR_PRINT_DEBUG(smbXsrv_connection_passB
, &pass_blob
);
650 if (!GUID_equal(&client
->global
->client_guid
, &pass_info0
->client_guid
))
652 struct GUID_txt_buf buf1
, buf2
;
654 DBG_WARNING("client's client_guid [%s] != passed guid [%s]\n",
655 GUID_buf_string(&client
->global
->client_guid
,
657 GUID_buf_string(&pass_info0
->client_guid
,
659 if (DEBUGLVL(DBGLVL_WARNING
)) {
660 NDR_PRINT_DEBUG(smbXsrv_connection_passB
, &pass_blob
);
665 if (client
->global
->initial_connect_time
!=
666 pass_info0
->initial_connect_time
)
668 DBG_WARNING("client's initial connect time [%s] (%llu) != "
669 "passed initial connect time [%s] (%llu)\n",
670 nt_time_string(talloc_tos(),
671 client
->global
->initial_connect_time
),
672 (unsigned long long)client
->global
->initial_connect_time
,
673 nt_time_string(talloc_tos(),
674 pass_info0
->initial_connect_time
),
675 (unsigned long long)pass_info0
->initial_connect_time
);
676 if (DEBUGLVL(DBGLVL_WARNING
)) {
677 NDR_PRINT_DEBUG(smbXsrv_connection_passB
, &pass_blob
);
682 status
= smbd_add_connection(client
,
684 pass_info0
->initial_connect_time
,
686 if (NT_STATUS_EQUAL(status
, NT_STATUS_NETWORK_ACCESS_DENIED
)) {
688 DLIST_REMOVE(client
->connections
, xconn
);
691 if (!NT_STATUS_IS_OK(status
)) {
692 DBG_ERR("smbd_add_connection => %s\n", nt_errstr(status
));
693 NDR_PRINT_DEBUG(smbXsrv_connection_passB
, &pass_blob
);
699 * Set seq_low to mid received in negprot
701 seq_low
= BVAL(pass_info0
->negotiate_request
.data
,
702 SMB2_HDR_MESSAGE_ID
);
704 xconn
->smb2
.client
.guid_verified
= true;
705 smbd_smb2_process_negprot(xconn
, seq_low
,
706 pass_info0
->negotiate_request
.data
,
707 pass_info0
->negotiate_request
.length
);
713 for (fd_idx
= 0; fd_idx
< rec
->num_fds
; fd_idx
++) {
714 sock_fd
= rec
->fds
[fd_idx
];
722 subreq
= messaging_filtered_read_send(client
,
725 smbXsrv_client_connection_pass_filter
,
727 if (subreq
== NULL
) {
729 r
= "messaging_read_send(MSG_SMBXSRV_CONNECTION_PASS failed";
730 exit_server_cleanly(r
);
733 tevent_req_set_callback(subreq
, smbXsrv_client_connection_pass_loop
, client
);
736 NTSTATUS
smbXsrv_client_update(struct smbXsrv_client
*client
)
738 struct smbXsrv_client_table
*table
= client
->table
;
741 if (client
->global
->db_rec
!= NULL
) {
742 struct GUID_txt_buf buf
;
743 DBG_ERR("guid [%s]: Called with db_rec != NULL'\n",
744 GUID_buf_string(&client
->global
->client_guid
,
746 return NT_STATUS_INTERNAL_ERROR
;
749 client
->global
->db_rec
= smbXsrv_client_global_fetch_locked(
750 table
->global
.db_ctx
,
751 &client
->global
->client_guid
,
752 client
->global
/* TALLOC_CTX */);
753 if (client
->global
->db_rec
== NULL
) {
754 return NT_STATUS_INTERNAL_DB_ERROR
;
757 status
= smbXsrv_client_global_store(client
->global
);
758 if (!NT_STATUS_IS_OK(status
)) {
759 struct GUID_txt_buf buf
;
760 DBG_ERR("client_guid[%s] store failed - %s\n",
761 GUID_buf_string(&client
->global
->client_guid
,
767 if (DEBUGLVL(DBGLVL_DEBUG
)) {
768 struct smbXsrv_clientB client_blob
= {
769 .version
= SMBXSRV_VERSION_0
,
770 .info
.info0
= client
,
772 struct GUID_txt_buf buf
;
774 DBG_DEBUG("client_guid[%s] stored\n",
775 GUID_buf_string(&client
->global
->client_guid
,
777 NDR_PRINT_DEBUG(smbXsrv_clientB
, &client_blob
);
783 NTSTATUS
smbXsrv_client_remove(struct smbXsrv_client
*client
)
785 struct smbXsrv_client_table
*table
= client
->table
;
788 if (client
->global
->db_rec
!= NULL
) {
789 struct GUID_txt_buf buf
;
790 DBG_ERR("client_guid[%s]: Called with db_rec != NULL'\n",
791 GUID_buf_string(&client
->global
->client_guid
,
793 return NT_STATUS_INTERNAL_ERROR
;
796 if (!client
->global
->stored
) {
800 client
->global
->db_rec
= smbXsrv_client_global_fetch_locked(
801 table
->global
.db_ctx
,
802 &client
->global
->client_guid
,
803 client
->global
/* TALLOC_CTX */);
804 if (client
->global
->db_rec
== NULL
) {
805 return NT_STATUS_INTERNAL_DB_ERROR
;
808 status
= smbXsrv_client_global_remove(client
->global
);
809 if (!NT_STATUS_IS_OK(status
)) {
810 struct GUID_txt_buf buf
;
811 DBG_ERR("client_guid[%s] store failed - %s\n",
812 GUID_buf_string(&client
->global
->client_guid
, &buf
),
817 if (DEBUGLVL(DBGLVL_DEBUG
)) {
818 struct smbXsrv_clientB client_blob
= {
819 .version
= SMBXSRV_VERSION_0
,
820 .info
.info0
= client
,
822 struct GUID_txt_buf buf
;
824 DBG_DEBUG("client_guid[%s] stored\n",
825 GUID_buf_string(&client
->global
->client_guid
, &buf
));
826 NDR_PRINT_DEBUG(smbXsrv_clientB
, &client_blob
);