~ubuntu-branches/ubuntu/utopic/dropbear/utopic-proposed

« back to all changes in this revision

Viewing changes to cli-session.c

  • Committer: Bazaar Package Importer
  • Author(s): Gerrit Pape, Matt Johnston, Gerrit Pape
  • Date: 2008-11-19 20:58:59 UTC
  • mfrom: (1.4.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: james.westby@ubuntu.com-20081119205859-dmeze0y6b16ia93v
Tags: 0.52-1
[ Matt Johnston ]
* New upstream release.
  * dbclient.1: mention optional 'command' argument (closes: #495823).

[ Gerrit Pape ]
* debian/diff/0001-dbclient.1-dbclient-uses-compression-if...diff:
  new; dbclient.1: dbclient uses compression if compiled with zlib
  support (thx Luca Capello, closes: #495825).
* debian/initramfs/*: new; cryptroot remote unlocking on boot feature
  (thx debian@x.ray.net).
* debian/rules: install debian/initramfs/* (thx debian@x.ray.net).
* debian/control: Suggests: udev (for cryptroot support, thx
  debian@x.ray.net).
* debian/dropbear.postinst: conditionally run update-initramfs -u
  (for cryptroot support, thx debian@x.ray.net. closes: #465903).
* debian/diff/0002-dropbearkey.8-mention-y-option-add-example.diff:
  new; mention -y option, add example (thx debian@x.ray.net).

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
        {SSH_MSG_CHANNEL_OPEN_FAILURE, recv_msg_channel_open_failure},
65
65
        {SSH_MSG_USERAUTH_BANNER, recv_msg_userauth_banner}, /* client */
66
66
        {SSH_MSG_USERAUTH_SPECIFIC_60, recv_msg_userauth_specific_60}, /* client */
 
67
#ifdef  ENABLE_CLI_REMOTETCPFWD
 
68
        {SSH_MSG_REQUEST_SUCCESS, cli_recv_msg_request_success}, /* client */
 
69
        {SSH_MSG_REQUEST_FAILURE, cli_recv_msg_request_failure}, /* client */
 
70
#endif
67
71
        {0, 0} /* End */
68
72
};
69
73
 
74
78
        NULL /* Null termination */
75
79
};
76
80
 
77
 
void cli_session(int sock, char* remotehost) {
 
81
void cli_session(int sock_in, int sock_out, char* remotehost) {
78
82
 
79
83
        seedrandom();
80
84
 
81
85
        crypto_init();
82
86
 
83
 
        common_session_init(sock, remotehost);
 
87
        common_session_init(sock_in, sock_out, remotehost);
84
88
 
85
89
        chaninitialise(cli_chantypes);
86
90
 
197
201
                        TRACE(("leave cli_sessionloop: cli_auth_try"))
198
202
                        return;
199
203
 
200
 
                        /*
201
 
                case USERAUTH_SUCCESS_RCVD:
202
 
                        send_msg_service_request(SSH_SERVICE_CONNECTION);
203
 
                        cli_ses.state = SERVICE_CONN_REQ_SENT;
204
 
                        TRACE(("leave cli_sessionloop: sent ssh-connection service req"))
205
 
                        return;
206
 
 
207
 
                case SERVICE_CONN_ACCEPT_RCVD:
208
 
                        cli_send_chansess_request();
209
 
                        TRACE(("leave cli_sessionloop: cli_send_chansess_request"))
210
 
                        cli_ses.state = SESSION_RUNNING;
211
 
                        return;
212
 
                        */
213
 
 
214
204
                case USERAUTH_SUCCESS_RCVD:
215
205
 
216
206
                        if (cli_opts.backgrounded) {
235
225
#ifdef ENABLE_CLI_REMOTETCPFWD
236
226
                        setup_remotetcp();
237
227
#endif
238
 
                        if (!cli_opts.no_cmd) {
 
228
 
 
229
#ifdef ENABLE_CLI_NETCAT
 
230
                        if (cli_opts.netcat_host) {
 
231
                                cli_send_netcat_request();
 
232
                        } else 
 
233
#endif
 
234
                                if (!cli_opts.no_cmd) {
239
235
                                cli_send_chansess_request();
240
236
                        }
241
237
                        TRACE(("leave cli_sessionloop: running"))
294
290
 
295
291
        /* XXX TODO perhaps print a friendlier message if we get this but have
296
292
         * already sent/received disconnect message(s) ??? */
297
 
        close(ses.sock);
298
 
        ses.sock = -1;
 
293
        m_close(ses.sock_in);
 
294
        m_close(ses.sock_out);
 
295
        ses.sock_in = -1;
 
296
        ses.sock_out = -1;
299
297
        dropbear_exit("remote closed the connection");
300
298
}
301
299