Skip to content

Change port separator to semicolon : since it's more standard #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions manpages/dbclient.1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dbclient \- lightweight SSH client

.B dbclient
[\fIargs\fR]
[\fIuser1\fR]@\fIhost1\fR[^\fIport1\fR],[\fIuser2\fR]@\fIhost2\fR[^\fIport2\fR],...
[\fIuser1\fR]@\fIhost1\fR[:\fIport1\fR],[\fIuser2\fR]@\fIhost2\fR[:\fIport2\fR],...

.SH DESCRIPTION
.B dbclient
Expand All @@ -32,7 +32,7 @@ host argument. If no command is specified an interactive terminal will be opened
.B \-p \fIport
Connect to
.I port
on the remote host. Alternatively a port can be specified as hostname^port.
on the remote host. Alternatively a port can be specified as hostname:port.
Default is 22.
.TP
.B \-i \fIidfile
Expand Down Expand Up @@ -194,7 +194,7 @@ Dropbear will also allow multiple "hops" to be specified, separated by commas. I
this case a connection will be made to the first host, then a TCP forwarded
connection will be made through that to the second host, and so on. Hosts other than
the final destination will not see anything other than the encrypted SSH stream.
A port for a host can be specified with a caret (eg matt@martello^44 ).
A port for a host can be specified with a caret (eg matt@martello:44 ).
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed this.

Suggested change
A port for a host can be specified with a caret (eg matt@martello:44 ).
A port for a host can be specified with a colon (eg matt@martello:44 ).

This syntax can also be used with scp or rsync (specifying dbclient as the
ssh/rsh command). A file can be "bounced" through multiple SSH hops, eg

Expand All @@ -205,7 +205,7 @@ in the example above, the same way as other -L TCP forwarded hosts are. Host key
checked locally based on the given hostname.

.SH ESCAPE CHARACTERS
Typing a newline followed by the key sequence \fI~.\fR (tilde, dot) will terminate a connection.
Typing a newline followed by the key sequence \fI~.\fR (tilde, dot) will terminate a connection.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an not related typo.

The sequence \fI~^Z\fR (tilde, ctrl-z) will background the connection. This behaviour only
applies when a PTY is used.

Expand Down
12 changes: 8 additions & 4 deletions src/cli-runopts.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ static void parse_multihop_hostname(const char* orighostarg, const char* argv0)
}
#endif /* !DROPBEAR_CLI_MULTIHOP */

/* Parses a [user@]hostname[/port] argument. */
/* Parses a [user@]hostname[:port] argument. */
static void parse_hostname(const char* orighostarg) {
char *userhostarg = NULL;
char *port = NULL;
Expand All @@ -679,10 +679,14 @@ static void parse_hostname(const char* orighostarg) {
cli_opts.username = m_strdup(cli_opts.own_user);
}

port = strchr(cli_opts.remotehost, '^');
port = strchr(cli_opts.remotehost, ':');
if (!port) {
/* legacy separator */
port = strchr(cli_opts.remotehost, '/');
/* legacy separator '^' */
port = strchr(cli_opts.remotehost, '^');
if (!port) {
/* legacy separator '/' */
port = strchr(cli_opts.remotehost, '/');
}
}
if (port) {
*port = '\0';
Expand Down