Mercurial > dropbear
comparison cli-main.c @ 118:5312ca05ed48 private-rez
propagate of 717950f4061f1123659ee87c7c168805af920ab7 and 839f98f136788cc1466e4641bf796f96040a085d from branch 'matt.dbclient.authpam' to 'matt.dbclient.rez'
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sun, 12 Sep 2004 04:56:50 +0000 |
parents | 2e9d1f29c50f |
children | 0cfba3034be5 |
comparison
equal
deleted
inserted
replaced
57:3b2a5a1c4347 | 118:5312ca05ed48 |
---|---|
1 /* | |
2 * Dropbear - a SSH2 server | |
3 * SSH client implementation | |
4 * | |
5 * Copyright (c) 2002,2003 Matt Johnston | |
6 * Copyright (c) 2004 by Mihnea Stoenescu | |
7 * All rights reserved. | |
8 * | |
9 * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 * of this software and associated documentation files (the "Software"), to deal | |
11 * in the Software without restriction, including without limitation the rights | |
12 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
13 * copies of the Software, and to permit persons to whom the Software is | |
14 * furnished to do so, subject to the following conditions: | |
15 * | |
16 * The above copyright notice and this permission notice shall be included in | |
17 * all copies or substantial portions of the Software. | |
18 * | |
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
25 * SOFTWARE. */ | |
26 | |
1 #include "includes.h" | 27 #include "includes.h" |
2 #include "dbutil.h" | 28 #include "dbutil.h" |
3 #include "runopts.h" | 29 #include "runopts.h" |
4 #include "session.h" | 30 #include "session.h" |
5 | 31 |
23 | 49 |
24 cli_getopts(argc, argv); | 50 cli_getopts(argc, argv); |
25 | 51 |
26 TRACE(("user='%s' host='%s' port='%s'", cli_opts.username, | 52 TRACE(("user='%s' host='%s' port='%s'", cli_opts.username, |
27 cli_opts.remotehost, cli_opts.remoteport)); | 53 cli_opts.remotehost, cli_opts.remoteport)); |
54 | |
55 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { | |
56 dropbear_exit("signal() error"); | |
57 } | |
28 | 58 |
29 sock = connect_remote(cli_opts.remotehost, cli_opts.remoteport, | 59 sock = connect_remote(cli_opts.remotehost, cli_opts.remoteport, |
30 0, &error); | 60 0, &error); |
31 | 61 |
32 if (sock < 0) { | 62 if (sock < 0) { |
68 _dropbear_log(LOG_INFO, fmtbuf, param); | 98 _dropbear_log(LOG_INFO, fmtbuf, param); |
69 | 99 |
70 exit(exitcode); | 100 exit(exitcode); |
71 } | 101 } |
72 | 102 |
73 static void cli_dropbear_log(int priority, const char* format, va_list param) { | 103 static void cli_dropbear_log(int UNUSED(priority), |
104 const char* format, va_list param) { | |
74 | 105 |
75 char printbuf[1024]; | 106 char printbuf[1024]; |
76 | 107 |
77 vsnprintf(printbuf, sizeof(printbuf), format, param); | 108 vsnprintf(printbuf, sizeof(printbuf), format, param); |
78 | 109 |