comparison 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
comparison
equal deleted inserted replaced
417:fb02e3180d90 418:ab57ba0cb667
50 "-l <username>\n" 50 "-l <username>\n"
51 "-t Allocate a pty\n" 51 "-t Allocate a pty\n"
52 "-T Don't allocate a pty\n" 52 "-T Don't allocate a pty\n"
53 "-N Don't run a remote command\n" 53 "-N Don't run a remote command\n"
54 "-f Run in background after auth\n" 54 "-f Run in background after auth\n"
55 "-y Always accept remote host key if unknown\n"
55 #ifdef ENABLE_CLI_PUBKEY_AUTH 56 #ifdef ENABLE_CLI_PUBKEY_AUTH
56 "-i <identityfile> (multiple allowed)\n" 57 "-i <identityfile> (multiple allowed)\n"
57 #endif 58 #endif
58 #ifdef ENABLE_CLI_LOCALTCPFWD 59 #ifdef ENABLE_CLI_LOCALTCPFWD
59 "-L <listenport:remotehost:remoteport> Local port forwarding\n" 60 "-L <listenport:remotehost:remoteport> Local port forwarding\n"
91 cli_opts.username = NULL; 92 cli_opts.username = NULL;
92 cli_opts.cmd = NULL; 93 cli_opts.cmd = NULL;
93 cli_opts.no_cmd = 0; 94 cli_opts.no_cmd = 0;
94 cli_opts.backgrounded = 0; 95 cli_opts.backgrounded = 0;
95 cli_opts.wantpty = 9; /* 9 means "it hasn't been touched", gets set later */ 96 cli_opts.wantpty = 9; /* 9 means "it hasn't been touched", gets set later */
97 cli_opts.always_accept_key = 0;
96 #ifdef ENABLE_CLI_PUBKEY_AUTH 98 #ifdef ENABLE_CLI_PUBKEY_AUTH
97 cli_opts.privkeys = NULL; 99 cli_opts.privkeys = NULL;
98 #endif 100 #endif
99 #ifdef ENABLE_CLI_LOCALTCPFWD 101 #ifdef ENABLE_CLI_LOCALTCPFWD
100 cli_opts.localfwds = NULL; 102 cli_opts.localfwds = NULL;
146 148
147 if (argv[i][0] == '-') { 149 if (argv[i][0] == '-') {
148 /* A flag *waves* */ 150 /* A flag *waves* */
149 151
150 switch (argv[i][1]) { 152 switch (argv[i][1]) {
153 case 'y': /* always accept the remote hostkey */
154 cli_opts.always_accept_key = 1;
155 break;
151 case 'p': /* remoteport */ 156 case 'p': /* remoteport */
152 next = &cli_opts.remoteport; 157 next = &cli_opts.remoteport;
153 break; 158 break;
154 #ifdef ENABLE_CLI_PUBKEY_AUTH 159 #ifdef ENABLE_CLI_PUBKEY_AUTH
155 case 'i': /* an identityfile */ 160 case 'i': /* an identityfile */