# HG changeset patch # User Matt Johnston # Date 1149692480 0 # Node ID 0e4f225b7e07e75a48cf1de4402c0461e90618d6 # Parent bc7c134982dfafee5f241b5048319969cc2e9544 Add -N "no remote command" dbclient option. Document -N in dbclient.1 and -P in dropbear.8 diff -r bc7c134982df -r 0e4f225b7e07 cli-runopts.c --- a/cli-runopts.c Wed Jun 07 14:48:35 2006 +0000 +++ b/cli-runopts.c Wed Jun 07 15:01:20 2006 +0000 @@ -50,6 +50,7 @@ "-l \n" "-t Allocate a pty\n" "-T Don't allocate a pty\n" + "-N Don't run a remote command\n" #ifdef ENABLE_CLI_PUBKEY_AUTH "-i (multiple allowed)\n" #endif @@ -88,6 +89,7 @@ cli_opts.remoteport = NULL; cli_opts.username = NULL; cli_opts.cmd = NULL; + cli_opts.no_cmd = 0; cli_opts.wantpty = 9; /* 9 means "it hasn't been touched", gets set later */ #ifdef ENABLE_CLI_PUBKEY_AUTH cli_opts.privkeys = NULL; @@ -163,6 +165,9 @@ case 'T': /* don't want a pty */ cli_opts.wantpty = 0; break; + case 'N': + cli_opts.no_cmd = 1; + break; #ifdef ENABLE_CLI_LOCALTCPFWD case 'L': nextislocal = 1; diff -r bc7c134982df -r 0e4f225b7e07 cli-session.c --- a/cli-session.c Wed Jun 07 14:48:35 2006 +0000 +++ b/cli-session.c Wed Jun 07 15:01:20 2006 +0000 @@ -218,13 +218,15 @@ #ifdef ENABLE_CLI_REMOTETCPFWD setup_remotetcp(); #endif - cli_send_chansess_request(); - TRACE(("leave cli_sessionloop: cli_send_chansess_request")) + if (!cli_opts.no_cmd) { + cli_send_chansess_request(); + } + TRACE(("leave cli_sessionloop: running")) cli_ses.state = SESSION_RUNNING; return; case SESSION_RUNNING: - if (ses.chancount < 1) { + if (ses.chancount < 1 && !cli_opts.no_cmd) { cli_finished(); } diff -r bc7c134982df -r 0e4f225b7e07 dbclient.1 --- a/dbclient.1 Wed Jun 07 14:48:35 2006 +0000 +++ b/dbclient.1 Wed Jun 07 15:01:20 2006 +0000 @@ -60,6 +60,9 @@ .B \-T Don't allocate a pty. .TP +.B \-N +Don't request a remote shell or run any commands. Any command arguments are ignored. +.TP .B \-g Allow non-local hosts to connect to forwarded ports. Applies to -L and -R forwarded ports, though remote connections to -R forwarded ports may be limited diff -r bc7c134982df -r 0e4f225b7e07 dropbear.8 --- a/dropbear.8 Wed Jun 07 14:48:35 2006 +0000 +++ b/dropbear.8 Wed Jun 07 15:01:20 2006 +0000 @@ -72,6 +72,10 @@ under TCP/IP servers like inetd, tcpsvd, or tcpserver. In program mode the \-F option is implied, and \-p options are ignored. .TP +.B \-P \fIpidfile +Specify a pidfile to create when running as a daemon. If not specified, the +default is /var/run/dropbear.pid +.TP .B \-a Allow remote hosts to connect to forwarded ports. .SH AUTHOR diff -r bc7c134982df -r 0e4f225b7e07 dropbearkey.c --- a/dropbearkey.c Wed Jun 07 14:48:35 2006 +0000 +++ b/dropbearkey.c Wed Jun 07 15:01:20 2006 +0000 @@ -321,8 +321,7 @@ /* a user@host comment is informative */ username = ""; pw = getpwuid(getuid()); - if (pw) - { + if (pw) { username = pw->pw_name; } diff -r bc7c134982df -r 0e4f225b7e07 runopts.h --- a/runopts.h Wed Jun 07 14:48:35 2006 +0000 +++ b/runopts.h Wed Jun 07 15:01:20 2006 +0000 @@ -102,6 +102,7 @@ char *cmd; int wantpty; + int no_cmd; #ifdef ENABLE_CLI_PUBKEY_AUTH struct SignKeyList *privkeys; /* Keys to use for public-key auth */ #endif