Mercurial > dropbear
diff cli-runopts.c @ 418:ab57ba0cb667
Add '-y' option to dbclient to accept the host key without checking
- patch from Luciano Miguel Ferreira Rocha.
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sun, 11 Feb 2007 08:50:21 +0000 |
parents | 47bcc3536bd5 |
children | d82a2a44c684 |
line wrap: on
line diff
--- a/cli-runopts.c Fri Feb 09 10:55:20 2007 +0000 +++ b/cli-runopts.c Sun Feb 11 08:50:21 2007 +0000 @@ -52,6 +52,7 @@ "-T Don't allocate a pty\n" "-N Don't run a remote command\n" "-f Run in background after auth\n" + "-y Always accept remote host key if unknown\n" #ifdef ENABLE_CLI_PUBKEY_AUTH "-i <identityfile> (multiple allowed)\n" #endif @@ -93,6 +94,7 @@ cli_opts.no_cmd = 0; cli_opts.backgrounded = 0; cli_opts.wantpty = 9; /* 9 means "it hasn't been touched", gets set later */ + cli_opts.always_accept_key = 0; #ifdef ENABLE_CLI_PUBKEY_AUTH cli_opts.privkeys = NULL; #endif @@ -148,6 +150,9 @@ /* A flag *waves* */ switch (argv[i][1]) { + case 'y': /* always accept the remote hostkey */ + cli_opts.always_accept_key = 1; + break; case 'p': /* remoteport */ next = &cli_opts.remoteport; break;