# HG changeset patch # User Matt Johnston # Date 1406469986 -28800 # Node ID 17d874ae93a125c0ae114df5d15c9afd5897cfe3 # Parent 2e402a09e21ea1181cd7dec7065c2821e47dabf4 Add '-V' for version -h should exit with success Update manpages diff -r 2e402a09e21e -r 17d874ae93a1 cli-runopts.c --- a/cli-runopts.c Sat Jul 26 10:18:55 2014 +0800 +++ b/cli-runopts.c Sun Jul 27 22:06:26 2014 +0800 @@ -90,6 +90,7 @@ "-c Specify preferred ciphers ('-c help' to list options)\n" "-m Specify preferred MACs for packet verification (or '-m help')\n" #endif + "-V Version\n" #ifdef DEBUG_TRACE "-v verbose (compiled with DEBUG_TRACE)\n" #endif @@ -324,6 +325,10 @@ #ifndef ENABLE_CLI_LOCALTCPFWD case 'L': #endif + case 'V': + print_version(); + exit(EXIT_SUCCESS); + break; case 'o': case 'b': next = &dummy; diff -r 2e402a09e21e -r 17d874ae93a1 common-runopts.c --- a/common-runopts.c Sat Jul 26 10:18:55 2014 +0800 +++ b/common-runopts.c Sun Jul 27 22:06:26 2014 +0800 @@ -106,3 +106,8 @@ } #endif +void print_version(const char* name) { + fprintf(stderr, "Dropbear %s v%s\n", name, DROPBEAR_VERSION); +} + + diff -r 2e402a09e21e -r 17d874ae93a1 dbclient.1 --- a/dbclient.1 Sat Jul 26 10:18:55 2014 +0800 +++ b/dbclient.1 Sun Jul 27 22:06:26 2014 +0800 @@ -19,8 +19,7 @@ .SH DESCRIPTION .B dbclient -is a SSH client designed to be small enough to be used in small memory -environments, while still being functional and secure enough for general use. +is a small SSH client .SH OPTIONS .TP .B \-p \fIport @@ -98,7 +97,7 @@ useful for working around firewalls or routers that drop connections after a certain period of inactivity. The trade-off is that a session may be closed if there is a temporary lapse of network connectivity. A setting -if 0 disables keepalives. +if 0 disables keepalives. If no response is received for 3 consecutive keepalives the connection will be closed. .TP .B \-I \fIidle_timeout Disconnect the session if no traffic is transmitted or received for \fIidle_timeout\fR seconds. @@ -121,6 +120,9 @@ .TP .B \-s The specified command will be requested as a subsystem, used for sftp. Dropbear doesn't implement sftp itself but the OpenSSH sftp client can be used eg \fIsftp -S dbclient user@host\fR +.TP +.B \-V +Print the version .SH MULTI-HOP Dropbear will also allow multiple "hops" to be specified, separated by commas. In diff -r 2e402a09e21e -r 17d874ae93a1 dropbear.8 --- a/dropbear.8 Sat Jul 26 10:18:55 2014 +0800 +++ b/dropbear.8 Sun Jul 27 22:06:26 2014 +0800 @@ -10,8 +10,7 @@ .IR [address:]port ] .SH DESCRIPTION .B dropbear -is a SSH server designed to be small enough to be used in small memory -environments, while still being functional and secure enough for general use. +is a small SSH server .SH OPTIONS .TP .B \-b \fIbanner @@ -88,10 +87,14 @@ useful for working around firewalls or routers that drop connections after a certain period of inactivity. The trade-off is that a session may be closed if there is a temporary lapse of network connectivity. A setting -if 0 disables keepalives. +if 0 disables keepalives. If no response is received for 3 consecutive keepalives the connection will be closed. .TP .B \-I \fIidle_timeout Disconnect the session if no traffic is transmitted or received for \fIidle_timeout\fR seconds. +.TP +.B \-V +Print the version + .SH FILES .TP diff -r 2e402a09e21e -r 17d874ae93a1 runopts.h --- a/runopts.h Sat Jul 26 10:18:55 2014 +0800 +++ b/runopts.h Sun Jul 27 22:06:26 2014 +0800 @@ -164,4 +164,6 @@ void parse_ciphers_macs(); #endif +void print_version(const char* name); + #endif /* _RUNOPTS_H_ */ diff -r 2e402a09e21e -r 17d874ae93a1 svr-runopts.c --- a/svr-runopts.c Sat Jul 26 10:18:55 2014 +0800 +++ b/svr-runopts.c Sun Jul 27 22:06:26 2014 +0800 @@ -92,6 +92,7 @@ "-W (default %d, larger may be faster, max 1MB)\n" "-K (0 is never, default %d, in seconds)\n" "-I (0 is never, default %d, in seconds)\n" + "-V Version\n" #ifdef DEBUG_TRACE "-v verbose (compiled with DEBUG_TRACE)\n" #endif @@ -256,7 +257,7 @@ #endif case 'h': printhelp(argv[0]); - exit(EXIT_FAILURE); + exit(EXIT_SUCCESS); break; case 'u': /* backwards compatibility with old urandom option */ @@ -266,6 +267,10 @@ debug_trace = 1; break; #endif + case 'V': + print_version("server"); + exit(EXIT_SUCCESS); + break; default: fprintf(stderr, "Unknown argument %s\n", argv[i]); printhelp(argv[0]);