diff options
Diffstat (limited to 'clientloop.c')
-rw-r--r-- | clientloop.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/clientloop.c b/clientloop.c index 47f3c7ecd..b76f7cfe0 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -59,7 +59,7 @@ | |||
59 | */ | 59 | */ |
60 | 60 | ||
61 | #include "includes.h" | 61 | #include "includes.h" |
62 | RCSID("$OpenBSD: clientloop.c,v 1.141 2005/07/16 01:35:24 djm Exp $"); | 62 | RCSID("$OpenBSD: clientloop.c,v 1.149 2005/12/30 15:56:37 reyk Exp $"); |
63 | 63 | ||
64 | #include "ssh.h" | 64 | #include "ssh.h" |
65 | #include "ssh1.h" | 65 | #include "ssh1.h" |
@@ -77,6 +77,7 @@ RCSID("$OpenBSD: clientloop.c,v 1.141 2005/07/16 01:35:24 djm Exp $"); | |||
77 | #include "log.h" | 77 | #include "log.h" |
78 | #include "readconf.h" | 78 | #include "readconf.h" |
79 | #include "clientloop.h" | 79 | #include "clientloop.h" |
80 | #include "sshconnect.h" | ||
80 | #include "authfd.h" | 81 | #include "authfd.h" |
81 | #include "atomicio.h" | 82 | #include "atomicio.h" |
82 | #include "sshpty.h" | 83 | #include "sshpty.h" |
@@ -113,7 +114,7 @@ extern char *host; | |||
113 | static volatile sig_atomic_t received_window_change_signal = 0; | 114 | static volatile sig_atomic_t received_window_change_signal = 0; |
114 | static volatile sig_atomic_t received_signal = 0; | 115 | static volatile sig_atomic_t received_signal = 0; |
115 | 116 | ||
116 | /* Flag indicating whether the user\'s terminal is in non-blocking mode. */ | 117 | /* Flag indicating whether the user's terminal is in non-blocking mode. */ |
117 | static int in_non_blocking_mode = 0; | 118 | static int in_non_blocking_mode = 0; |
118 | 119 | ||
119 | /* Common data for the client loop code. */ | 120 | /* Common data for the client loop code. */ |
@@ -266,7 +267,7 @@ client_x11_get_proto(const char *display, const char *xauth_path, | |||
266 | } | 267 | } |
267 | } | 268 | } |
268 | snprintf(cmd, sizeof(cmd), | 269 | snprintf(cmd, sizeof(cmd), |
269 | "%s %s%s list %s . 2>" _PATH_DEVNULL, | 270 | "%s %s%s list %s 2>" _PATH_DEVNULL, |
270 | xauth_path, | 271 | xauth_path, |
271 | generated ? "-f " : "" , | 272 | generated ? "-f " : "" , |
272 | generated ? xauthfile : "", | 273 | generated ? xauthfile : "", |
@@ -914,6 +915,15 @@ process_cmdline(void) | |||
914 | logit(" -Lport:host:hostport Request local forward"); | 915 | logit(" -Lport:host:hostport Request local forward"); |
915 | logit(" -Rport:host:hostport Request remote forward"); | 916 | logit(" -Rport:host:hostport Request remote forward"); |
916 | logit(" -KRhostport Cancel remote forward"); | 917 | logit(" -KRhostport Cancel remote forward"); |
918 | if (!options.permit_local_command) | ||
919 | goto out; | ||
920 | logit(" !args Execute local command"); | ||
921 | goto out; | ||
922 | } | ||
923 | |||
924 | if (*s == '!' && options.permit_local_command) { | ||
925 | s++; | ||
926 | ssh_local_cmd(s); | ||
917 | goto out; | 927 | goto out; |
918 | } | 928 | } |
919 | 929 | ||
@@ -1376,10 +1386,10 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id) | |||
1376 | session_ident = ssh2_chan_id; | 1386 | session_ident = ssh2_chan_id; |
1377 | if (escape_char != SSH_ESCAPECHAR_NONE) | 1387 | if (escape_char != SSH_ESCAPECHAR_NONE) |
1378 | channel_register_filter(session_ident, | 1388 | channel_register_filter(session_ident, |
1379 | simple_escape_filter); | 1389 | simple_escape_filter, NULL); |
1380 | if (session_ident != -1) | 1390 | if (session_ident != -1) |
1381 | channel_register_cleanup(session_ident, | 1391 | channel_register_cleanup(session_ident, |
1382 | client_channel_closed); | 1392 | client_channel_closed, 0); |
1383 | } else { | 1393 | } else { |
1384 | /* Check if we should immediately send eof on stdin. */ | 1394 | /* Check if we should immediately send eof on stdin. */ |
1385 | client_check_initial_eof_on_stdin(); | 1395 | client_check_initial_eof_on_stdin(); |
@@ -1678,7 +1688,7 @@ client_request_x11(const char *request_type, int rchan) | |||
1678 | 1688 | ||
1679 | if (!options.forward_x11) { | 1689 | if (!options.forward_x11) { |
1680 | error("Warning: ssh server tried X11 forwarding."); | 1690 | error("Warning: ssh server tried X11 forwarding."); |
1681 | error("Warning: this is probably a break in attempt by a malicious server."); | 1691 | error("Warning: this is probably a break-in attempt by a malicious server."); |
1682 | return NULL; | 1692 | return NULL; |
1683 | } | 1693 | } |
1684 | originator = packet_get_string(NULL); | 1694 | originator = packet_get_string(NULL); |
@@ -1711,7 +1721,7 @@ client_request_agent(const char *request_type, int rchan) | |||
1711 | 1721 | ||
1712 | if (!options.forward_agent) { | 1722 | if (!options.forward_agent) { |
1713 | error("Warning: ssh server tried agent forwarding."); | 1723 | error("Warning: ssh server tried agent forwarding."); |
1714 | error("Warning: this is probably a break in attempt by a malicious server."); | 1724 | error("Warning: this is probably a break-in attempt by a malicious server."); |
1715 | return NULL; | 1725 | return NULL; |
1716 | } | 1726 | } |
1717 | sock = ssh_get_authentication_socket(); | 1727 | sock = ssh_get_authentication_socket(); |
@@ -1880,7 +1890,7 @@ client_session2_setup(int id, int want_tty, int want_subsystem, | |||
1880 | /* Split */ | 1890 | /* Split */ |
1881 | name = xstrdup(env[i]); | 1891 | name = xstrdup(env[i]); |
1882 | if ((val = strchr(name, '=')) == NULL) { | 1892 | if ((val = strchr(name, '=')) == NULL) { |
1883 | free(name); | 1893 | xfree(name); |
1884 | continue; | 1894 | continue; |
1885 | } | 1895 | } |
1886 | *val++ = '\0'; | 1896 | *val++ = '\0'; |
@@ -1894,7 +1904,7 @@ client_session2_setup(int id, int want_tty, int want_subsystem, | |||
1894 | } | 1904 | } |
1895 | if (!matched) { | 1905 | if (!matched) { |
1896 | debug3("Ignored env %s", name); | 1906 | debug3("Ignored env %s", name); |
1897 | free(name); | 1907 | xfree(name); |
1898 | continue; | 1908 | continue; |
1899 | } | 1909 | } |
1900 | 1910 | ||
@@ -1903,7 +1913,7 @@ client_session2_setup(int id, int want_tty, int want_subsystem, | |||
1903 | packet_put_cstring(name); | 1913 | packet_put_cstring(name); |
1904 | packet_put_cstring(val); | 1914 | packet_put_cstring(val); |
1905 | packet_send(); | 1915 | packet_send(); |
1906 | free(name); | 1916 | xfree(name); |
1907 | } | 1917 | } |
1908 | } | 1918 | } |
1909 | 1919 | ||