s3:libsmb: Print debug message about Netbios
authorJustin Stephenson <jstephen@redhat.com>
Mon, 17 Dec 2018 19:40:33 +0000 (14:40 -0500)
committerKarolin Seeger <kseeger@samba.org>
Fri, 1 Feb 2019 10:34:09 +0000 (11:34 +0100)
With a preceding patch, cli_connect_nb() will return
NT_STATUS_NOT_SUPPORTED when 'disable netbios' is set in smb.conf.

Print an informative error message to indicate Netbios is disabled
if this occurs.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13727

Signed-off-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Noel Power <nopower@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 499f051c9d527a14f9712365f8403a1ee0662c5b)

source3/libsmb/clidfs.c
source3/libsmb/libsmb_server.c

index 0dfb8b336064595490561b7be2b5630dde651055..4342a3b1d1b20065b9684101efa7876f5f418e48 100644 (file)
@@ -196,9 +196,13 @@ static NTSTATUS do_connect(TALLOC_CTX *ctx,
                flags, &c);
 
        if (!NT_STATUS_IS_OK(status)) {
-               d_printf("Connection to %s failed (Error %s)\n",
-                               server,
-                               nt_errstr(status));
+               if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) {
+                       DBG_ERR("NetBIOS support disabled, unable to connect");
+               }
+
+               DBG_WARNING("Connection to %s failed (Error %s)\n",
+                           server,
+                           nt_errstr(status));
                return status;
        }
 
index 67dfcf72327dc4d2e8e77f83bc2ad70e3ee106cd..0067df48cac7bffd866e94d14787eafd47ef68b5 100644 (file)
@@ -489,6 +489,10 @@ SMBC_server_internal(TALLOC_CTX *ctx,
        }
 
        if (!NT_STATUS_IS_OK(status)) {
+               if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) {
+                       DBG_ERR("NetBIOS support disabled, unable to connect");
+               }
+
                errno = map_errno_from_nt_status(status);
                return NULL;
        }