Mercurial > dropbear
comparison cli-main.c @ 910:89555751c489 asm
merge up to 2013.63, improve ASM makefile rules a bit
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 27 Feb 2014 21:35:58 +0800 |
parents | aa689d140928 |
children | c88dce72f6d2 |
comparison
equal
deleted
inserted
replaced
909:e4b75744acab | 910:89555751c489 |
---|---|
26 | 26 |
27 #include "includes.h" | 27 #include "includes.h" |
28 #include "dbutil.h" | 28 #include "dbutil.h" |
29 #include "runopts.h" | 29 #include "runopts.h" |
30 #include "session.h" | 30 #include "session.h" |
31 #include "dbrandom.h" | |
32 #include "crypto_desc.h" | |
31 | 33 |
32 static void cli_dropbear_exit(int exitcode, const char* format, va_list param) ATTRIB_NORETURN; | 34 static void cli_dropbear_exit(int exitcode, const char* format, va_list param) ATTRIB_NORETURN; |
33 static void cli_dropbear_log(int priority, const char* format, va_list param); | 35 static void cli_dropbear_log(int priority, const char* format, va_list param); |
34 | 36 |
35 #ifdef ENABLE_CLI_PROXYCMD | 37 #ifdef ENABLE_CLI_PROXYCMD |
49 _dropbear_exit = cli_dropbear_exit; | 51 _dropbear_exit = cli_dropbear_exit; |
50 _dropbear_log = cli_dropbear_log; | 52 _dropbear_log = cli_dropbear_log; |
51 | 53 |
52 disallow_core(); | 54 disallow_core(); |
53 | 55 |
56 seedrandom(); | |
57 crypto_init(); | |
58 | |
54 cli_getopts(argc, argv); | 59 cli_getopts(argc, argv); |
55 | 60 |
56 TRACE(("user='%s' host='%s' port='%s'", cli_opts.username, | 61 TRACE(("user='%s' host='%s' port='%s'", cli_opts.username, |
57 cli_opts.remotehost, cli_opts.remoteport)) | 62 cli_opts.remotehost, cli_opts.remoteport)) |
58 | 63 |
68 #endif | 73 #endif |
69 { | 74 { |
70 int sock = connect_remote(cli_opts.remotehost, cli_opts.remoteport, | 75 int sock = connect_remote(cli_opts.remotehost, cli_opts.remoteport, |
71 0, &error); | 76 0, &error); |
72 sock_in = sock_out = sock; | 77 sock_in = sock_out = sock; |
78 if (cli_opts.wantpty) { | |
79 set_sock_priority(sock, DROPBEAR_PRIO_LOWDELAY); | |
80 } | |
73 } | 81 } |
74 | 82 |
75 if (sock_in < 0) { | 83 if (sock_in < 0) { |
76 dropbear_exit("%s", error); | 84 dropbear_exit("%s", error); |
77 } | 85 } |
136 if (ret == DROPBEAR_FAILURE) { | 144 if (ret == DROPBEAR_FAILURE) { |
137 dropbear_exit("Failed running proxy command"); | 145 dropbear_exit("Failed running proxy command"); |
138 *sock_in = *sock_out = -1; | 146 *sock_in = *sock_out = -1; |
139 } | 147 } |
140 } | 148 } |
141 #endif // ENABLE_CLI_PROXYCMD | 149 #endif /* ENABLE_CLI_PROXYCMD */ |