winexe: Add support for connecting to a host on an alternate port
authorKarl Lenz <xorangekiller@gmail.com>
Fri, 5 Jul 2019 00:28:33 +0000 (20:28 -0400)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 5 Jul 2019 03:33:19 +0000 (03:33 +0000)
commit7425a8fbbe358c389f863a7295a95dff023f52dc
treeb6b584d0f8d04ad62f1c8a026a4518582202f608
parentf31333d40e6fa38daa32a3ebb32d5a317c06fc62
winexe: Add support for connecting to a host on an alternate port

This commit allows an optional port number to be specified after the
hostname on the winexe command line. If no port is given, it defaults
to port 445, just like it used before. Although this is probably a
pretty uncommon use-case, it allows port-forwarding the service through
a firewall to an alternate port, which can occassionally be helpful.

$ ./bin/winexe -U karl%password1 //127.0.0.1:5445 cmd.exe
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>

Signed-off-by: Karl Lenz <xorangekiller@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
examples/winexe/winexe.c