From: Justin Stephenson Date: Mon, 17 Dec 2018 20:17:24 +0000 (-0500) Subject: s3:utils:net: Print debug message about Netbios X-Git-Tag: tdb-1.3.17~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08867de2efde05e4730b41a335d13f775e44e397;p=thirdparty%2Fsamba.git s3:utils:net: 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 Autobuild-User(master): Noel Power Autobuild-Date(master): Wed Jan 9 22:38:21 CET 2019 on sn-devel-144 --- diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index c300b8a4b3d..f2d63d2af65 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -7455,6 +7455,9 @@ bool net_rpc_check(struct net_context *c, unsigned flags) lp_netbios_name(), SMB_SIGNING_IPC_DEFAULT, 0, &cli); if (!NT_STATUS_IS_OK(status)) { + if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { + DBG_ERR("NetBIOS support disabled, unable to connect\n"); + } return false; } status = smbXcli_negprot(cli->conn, cli->timeout, PROTOCOL_CORE, diff --git a/source3/utils/net_time.c b/source3/utils/net_time.c index 0091fc86333..5e6cf2ea15d 100644 --- a/source3/utils/net_time.c +++ b/source3/utils/net_time.c @@ -37,8 +37,13 @@ static time_t cli_servertime(const char *host, status = cli_connect_nb(host, dest_ss, 0, 0x20, lp_netbios_name(), SMB_SIGNING_DEFAULT, 0, &cli); if (!NT_STATUS_IS_OK(status)) { - fprintf(stderr, _("Can't contact server %s. Error %s\n"), - host, nt_errstr(status)); + if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) { + fprintf(stderr, "Can't contact server %s. NetBIOS support disabled," + " Error %s\n", host, nt_errstr(status)); + } else { + fprintf(stderr, "Can't contact server %s. Error %s\n", + host, nt_errstr(status)); + } goto done; }