From ecbb2f78cec6d9e6f5180c8ba274a1da2152f098 Mon Sep 17 00:00:00 2001 From: Justin Stephenson Date: Mon, 17 Dec 2018 14:57:59 -0500 Subject: [PATCH] s3:smbpasswd: Print debug message about Netbios 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 Reviewed-by: Noel Power Reviewed-by: Jeremy Allison --- source3/libsmb/passchange.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/source3/libsmb/passchange.c b/source3/libsmb/passchange.c index 48ffba8036f..f60e3079975 100644 --- a/source3/libsmb/passchange.c +++ b/source3/libsmb/passchange.c @@ -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; } -- 2.11.4.GIT