The Samba-Bugzilla – Attachment 14764 Details for
Bug 13727
Netbios traffic on port 139 is still sent with nmbd disabled and 'disable netbios' set
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
v4.9
v4_9_disable_netbios.patch (text/plain), 6.91 KB, created by
jstephen
on 2019-01-10 14:42:21 UTC
(
hide
)
Description:
v4.9
Filename:
MIME Type:
Creator:
jstephen
Created:
2019-01-10 14:42:21 UTC
Size:
6.91 KB
patch
obsolete
>From 3e7af5962075a047f53b55f265abd84f369901cb Mon Sep 17 00:00:00 2001 >From: Justin Stephenson <jstephen@redhat.com> >Date: Thu, 3 Jan 2019 12:07:01 -0500 >Subject: [PATCH 1/4] s3:libsmb: Check disable_netbios in socket connect > >If the disable_netbios option is set then return NT_STATUS_NOT_SUPPORTED >for a port 139 connection in the low level socket connection code. > >Signed-off-by: Justin Stephenson <jstephen@redhat.com> >Reviewed-by: Noel Power <nopower@suse.com> >Reviewed-by: Jeremy Allison <jra@samba.org> >--- > source3/libsmb/smbsock_connect.c | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/source3/libsmb/smbsock_connect.c b/source3/libsmb/smbsock_connect.c >index 9f915e1bb42..bb3cb07646c 100644 >--- a/source3/libsmb/smbsock_connect.c >+++ b/source3/libsmb/smbsock_connect.c >@@ -376,6 +376,11 @@ struct tevent_req *smbsock_connect_send(TALLOC_CTX *mem_ctx, > tevent_req_set_cleanup_fn(req, smbsock_connect_cleanup); > > if (port == NBT_SMB_PORT) { >+ if (lp_disable_netbios()) { >+ tevent_req_nterror(req, NT_STATUS_NOT_SUPPORTED); >+ return tevent_req_post(req, ev); >+ } >+ > state->req_139 = nb_connect_send(state, state->ev, state->addr, > state->called_name, > state->called_type, >-- >2.20.1 > > >From 41a6be706375dbbba9fccb7398408d98c0e80366 Mon Sep 17 00:00:00 2001 >From: Justin Stephenson <jstephen@redhat.com> >Date: Mon, 17 Dec 2018 14:40:33 -0500 >Subject: [PATCH 2/4] s3:libsmb: 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 <jstephen@redhat.com> >Reviewed-by: Noel Power <nopower@suse.com> >Reviewed-by: Jeremy Allison <jra@samba.org> >--- > source3/libsmb/clidfs.c | 10 +++++++--- > source3/libsmb/libsmb_server.c | 4 ++++ > 2 files changed, 11 insertions(+), 3 deletions(-) > >diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c >index 0dfb8b33606..4342a3b1d1b 100644 >--- a/source3/libsmb/clidfs.c >+++ b/source3/libsmb/clidfs.c >@@ -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; > } > >diff --git a/source3/libsmb/libsmb_server.c b/source3/libsmb/libsmb_server.c >index 67dfcf72327..0067df48cac 100644 >--- a/source3/libsmb/libsmb_server.c >+++ b/source3/libsmb/libsmb_server.c >@@ -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; > } >-- >2.20.1 > > >From 2bf3b09fb484c029d25faeeb5a5678996ad8e89c Mon Sep 17 00:00:00 2001 >From: Justin Stephenson <jstephen@redhat.com> >Date: Mon, 17 Dec 2018 14:57:59 -0500 >Subject: [PATCH 3/4] 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 <jstephen@redhat.com> >Reviewed-by: Noel Power <nopower@suse.com> >Reviewed-by: Jeremy Allison <jra@samba.org> >--- > 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.20.1 > > >From f54b306d577e29f6783af87981ce9ac80d69cd79 Mon Sep 17 00:00:00 2001 >From: Justin Stephenson <jstephen@redhat.com> >Date: Mon, 17 Dec 2018 15:17:24 -0500 >Subject: [PATCH 4/4] 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 <jstephen@redhat.com> >Reviewed-by: Noel Power <nopower@suse.com> >Reviewed-by: Jeremy Allison <jra@samba.org> > >Autobuild-User(master): Noel Power <npower@samba.org> >Autobuild-Date(master): Wed Jan 9 22:38:21 CET 2019 on sn-devel-144 >--- > source3/utils/net_rpc.c | 3 +++ > source3/utils/net_time.c | 9 +++++++-- > 2 files changed, 10 insertions(+), 2 deletions(-) > >diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c >index b99a036fca1..8cec09db199 100644 >--- a/source3/utils/net_rpc.c >+++ b/source3/utils/net_rpc.c >@@ -7425,6 +7425,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; > } > >-- >2.20.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
asn
:
review+
npower
:
review+
metze
:
review-
Actions:
View
Attachments on
bug 13727
:
14759
|
14760
|
14763
|
14764
|
14777
|
14785
|
14787