r4633: Finally give rpcclient a port-command.
authorGünther Deschner <gd@samba.org>
Mon, 10 Jan 2005 10:23:57 +0000 (10:23 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:53:49 +0000 (10:53 -0500)
Guenther

source/rpcclient/rpcclient.c

index 4d35b6d8a95383add06e47b64a2a17c945ad8198..acb65b7f7ceb8e1afd98c236f8c4490c8b89fdd3 100644 (file)
@@ -658,6 +658,7 @@ out_free:
        struct cmd_set          **cmd_set;
        struct in_addr          server_ip;
        NTSTATUS                nt_status;
+       static int              opt_port = 0;
 
        /* make sure the vars that get altered (4th field) are in
           a fixed location or certain compilers complain */
@@ -666,6 +667,7 @@ out_free:
                POPT_AUTOHELP
                {"command",     'c', POPT_ARG_STRING,   &cmdstr, 'c', "Execute semicolon separated cmds", "COMMANDS"},
                {"dest-ip", 'I', POPT_ARG_STRING,   &opt_ipaddr, 'I', "Specify destination IP address", "IP"},
+               {"port", 'p', POPT_ARG_INT,   &opt_port, 'p', "Specify port number", "PORT"},
                POPT_COMMON_SAMBA
                POPT_COMMON_CONNECTION
                POPT_COMMON_CREDENTIALS
@@ -739,7 +741,7 @@ out_free:
        }
        
        nt_status = cli_full_connection(&cli, global_myname(), server, 
-                                       opt_ipaddr ? &server_ip : NULL, 0,
+                                       opt_ipaddr ? &server_ip : NULL, opt_port,
                                        "IPC$", "IPC",  
                                        cmdline_auth_info.username, 
                                        lp_workgroup(),