Bug 2588 - sending messages with smbclient is not possible (3.0.12 and 3.0.13 are affected)
sending messages with smbclient is not possible (3.0.12 and 3.0.13 are affected)
Status: CLOSED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: smbclient
3.0.13
All All
: P3 normal
: none
Assigned To: Samba Bugzilla Account
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-04-10 17:01 UTC by Thomas Bork
Modified: 2005-08-24 10:22 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Bork 2005-04-10 17:01:03 UTC
smbclient from 3.0.12 and 3.0.13 is connecting to port 445 and not to port 139.
A patch for 3.0.13 follows.

I'm reported this in the samba maling list, but till today, no change in the SVN
source was made (I know, you are all busy).

Because on moday the 3.0.14 will be released and this is not changed in the
source, I'll posting the patch here another time.
Don't know, if it will break anything else...

--- /usr/src/samba-3.0.13/source/client/client.c        Wed Mar 23 21:30:28 2005
+++ /usr/src/samba-3.0.13/source/client/client.patched  Mon Mar 28 19:28:04 2005
@@ -3177,6 +3177,7 @@
                   else but port 139... */

                cli_cm_shutdown();
+               port = 139;
                cli_cm_set_port( 139 );
                cli = cli_cm_open(query_host, "IPC$", True);
        }
@@ -3339,8 +3340,9 @@
                        name_type = 0x03;
                        cli_cm_set_dest_name_type( name_type );
                        pstrcpy(desthost,poptGetOptArg(pc));
-                       if( !port )
-                               cli_cm_set_port( 139 );
+                       if (port != 139)
+                       port = 139;
+                       cli_cm_set_port( 139 );
                        message = True;
                        break;
                case 'I':


der tom
Comment 1 Gerald (Jerry) Carter 2005-04-10 20:37:18 UTC
Thanks Thomas.  Sorry for the delay in answering.
I've applied a modified patch (but same intent).
This will be fixed in 3.0.14 due out tomorrow.



Index: client/client.c
===================================================================
--- client/client.c     (revision 6290)
+++ client/client.c     (working copy)
@@ -3252,6 +3252,7 @@
        struct nmb_name called, calling;
        fstring server_name;
        char name_type_hex[10];
+       int msg_port;

        make_nmb_name(&calling, calling_name, 0x0);
        make_nmb_name(&called , desthost, name_type);
@@ -3264,7 +3265,11 @@
        if (have_ip)
                ip = dest_ip;

-       if (!(cli=cli_initialise(NULL)) || (cli_set_port(cli, port) != port) ||
+       /* we can only do messages over port 139 (to windows clients at least) */
+
+       msg_port = port ? port : 139;
+
+       if (!(cli=cli_initialise(NULL)) || (cli_set_port(cli, msg_port) !=
msg_port) ||
            !cli_connect(cli, server_name, &ip)) {
                d_printf("Connection to %s failed\n", desthost);
                return 1;
Comment 2 Gerald (Jerry) Carter 2005-08-24 10:22:54 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.