s3:smbpasswd: Print debug message about Netbios
authorJustin Stephenson <jstephen@redhat.com>
Mon, 17 Dec 2018 19:57:59 +0000 (14:57 -0500)
committerNoel Power <npower@samba.org>
Wed, 9 Jan 2019 17:40:44 +0000 (18:40 +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>
source3/libsmb/passchange.c

index 48ffba8..f60e307 100644 (file)
@@ -46,10 +46,18 @@ NTSTATUS remote_password_change(const char *remote_machine,
        result = cli_connect_nb(remote_machine, NULL, 0, 0x20, NULL,
                                SMB_SIGNING_IPC_DEFAULT, 0, &cli);
        if (!NT_STATUS_IS_OK(result)) {
-               if (asprintf(err_str, "Unable to connect to SMB server on "
-                        "machine %s. Error was : %s.\n",
-                        remote_machine, nt_errstr(result))==-1) {
-                       *err_str = NULL;
+               if (NT_STATUS_EQUAL(result, NT_STATUS_NOT_SUPPORTED)) {
+                       if (asprintf(err_str, "Unable to connect to SMB server on "
+                               "machine %s. NetBIOS support disabled\n",
+                               remote_machine) == -1) {
+                               *err_str = NULL;
+                       }
+               } else {
+                       if (asprintf(err_str, "Unable to connect to SMB server on "
+                                "machine %s. Error was : %s.\n",
+                                remote_machine, nt_errstr(result))==-1) {
+                               *err_str = NULL;
+                       }
                }
                return result;
        }