comparison cli-session.c @ 937:4ad38e223ccd

Send a failure response if a client receives a global request
author Matt Johnston <matt@ucc.asn.au>
date Tue, 08 Jul 2014 21:59:36 +0800
parents ff597bf2cfb0
children f7f6c15b0ec3
comparison
equal deleted inserted replaced
936:d93a6bcf616f 937:4ad38e223ccd
42 static void cli_sessionloop(); 42 static void cli_sessionloop();
43 static void cli_session_init(); 43 static void cli_session_init();
44 static void cli_finished(); 44 static void cli_finished();
45 static void recv_msg_service_accept(void); 45 static void recv_msg_service_accept(void);
46 static void cli_session_cleanup(void); 46 static void cli_session_cleanup(void);
47 static void recv_msg_global_request_cli(void);
47 48
48 struct clientsession cli_ses; /* GLOBAL */ 49 struct clientsession cli_ses; /* GLOBAL */
49 50
50 /* Sorted in decreasing frequency will be more efficient - data and window 51 /* Sorted in decreasing frequency will be more efficient - data and window
51 * should be first */ 52 * should be first */
66 {SSH_MSG_CHANNEL_CLOSE, recv_msg_channel_close}, 67 {SSH_MSG_CHANNEL_CLOSE, recv_msg_channel_close},
67 {SSH_MSG_CHANNEL_OPEN_CONFIRMATION, recv_msg_channel_open_confirmation}, 68 {SSH_MSG_CHANNEL_OPEN_CONFIRMATION, recv_msg_channel_open_confirmation},
68 {SSH_MSG_CHANNEL_OPEN_FAILURE, recv_msg_channel_open_failure}, 69 {SSH_MSG_CHANNEL_OPEN_FAILURE, recv_msg_channel_open_failure},
69 {SSH_MSG_USERAUTH_BANNER, recv_msg_userauth_banner}, /* client */ 70 {SSH_MSG_USERAUTH_BANNER, recv_msg_userauth_banner}, /* client */
70 {SSH_MSG_USERAUTH_SPECIFIC_60, recv_msg_userauth_specific_60}, /* client */ 71 {SSH_MSG_USERAUTH_SPECIFIC_60, recv_msg_userauth_specific_60}, /* client */
72 {SSH_MSG_GLOBAL_REQUEST, recv_msg_global_request_cli},
71 #ifdef ENABLE_CLI_REMOTETCPFWD 73 #ifdef ENABLE_CLI_REMOTETCPFWD
72 {SSH_MSG_REQUEST_SUCCESS, cli_recv_msg_request_success}, /* client */ 74 {SSH_MSG_REQUEST_SUCCESS, cli_recv_msg_request_success}, /* client */
73 {SSH_MSG_REQUEST_FAILURE, cli_recv_msg_request_failure}, /* client */ 75 {SSH_MSG_REQUEST_FAILURE, cli_recv_msg_request_failure}, /* client */
74 #endif 76 #endif
75 {0, 0} /* End */ 77 {0, 0} /* End */
364 } 366 }
365 } 367 }
366 /* Null terminate */ 368 /* Null terminate */
367 dirtytext[j] = '\0'; 369 dirtytext[j] = '\0';
368 } 370 }
371
372 static void recv_msg_global_request_cli(void) {
373 TRACE(("recv_msg_global_request_cli"))
374 /* Send a proper rejection */
375 send_msg_request_failure();
376 }