The branch, master has been updated
       via  08867de2efd s3:utils:net: Print debug message about Netbios
       via  ecbb2f78cec s3:smbpasswd: Print debug message about Netbios
       via  499f051c9d5 s3:libsmb: Print debug message about Netbios
       via  78f51a1d3c5 s3:libsmb: Check disable_netbios in socket connect
      from  a9def5c6971 s3:libsmb: Revert SMB Py bindings name back to 
libsmb_samba_internal

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 08867de2efde05e4730b41a335d13f775e44e397
Author: Justin Stephenson <[email protected]>
Date:   Mon Dec 17 15:17:24 2018 -0500

    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 <[email protected]>
    Reviewed-by: Noel Power <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>
    
    Autobuild-User(master): Noel Power <[email protected]>
    Autobuild-Date(master): Wed Jan  9 22:38:21 CET 2019 on sn-devel-144

commit ecbb2f78cec6d9e6f5180c8ba274a1da2152f098
Author: Justin Stephenson <[email protected]>
Date:   Mon Dec 17 14:57:59 2018 -0500

    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 <[email protected]>
    Reviewed-by: Noel Power <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 499f051c9d527a14f9712365f8403a1ee0662c5b
Author: Justin Stephenson <[email protected]>
Date:   Mon Dec 17 14:40:33 2018 -0500

    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 <[email protected]>
    Reviewed-by: Noel Power <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 78f51a1d3c53248159c1e7643364b62e52457bb9
Author: Justin Stephenson <[email protected]>
Date:   Thu Jan 3 12:07:01 2019 -0500

    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 <[email protected]>
    Reviewed-by: Noel Power <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 source3/libsmb/clidfs.c          |  4 ++++
 source3/libsmb/libsmb_server.c   |  4 ++++
 source3/libsmb/passchange.c      | 16 ++++++++++++----
 source3/libsmb/smbsock_connect.c |  5 +++++
 source3/utils/net_rpc.c          |  3 +++
 source3/utils/net_time.c         |  9 +++++++--
 6 files changed, 35 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 6918802396c..4342a3b1d1b 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -196,6 +196,10 @@ static NTSTATUS do_connect(TALLOC_CTX *ctx,
                flags, &c);
 
        if (!NT_STATUS_IS_OK(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));
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;
        }
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;
        }
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,
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;
        }
 


-- 
Samba Shared Repository

Reply via email to