Fixed issue #3815: TortoiseGitMerge crashes on Win7 on startup when winrt libraries...
[TortoiseGit.git] / src / TortoisePlink / sshutils.c
blob986942975e43c0453b0a7897cf230b5d37e21721
1 /*
2 * Supporting routines used in common by all the various components of
3 * the SSH system.
4 */
6 #include <assert.h>
7 #include <stdlib.h>
9 #include "putty.h"
10 #include "ssh.h"
11 #include "sshchan.h"
13 /* ----------------------------------------------------------------------
14 * Centralised standard methods for other channel implementations to
15 * borrow.
18 void chan_remotely_opened_confirmation(Channel *chan)
20 unreachable("this channel type should never receive OPEN_CONFIRMATION");
23 void chan_remotely_opened_failure(Channel *chan, const char *errtext)
25 unreachable("this channel type should never receive OPEN_FAILURE");
28 bool chan_default_want_close(
29 Channel *chan, bool sent_local_eof, bool rcvd_remote_eof)
32 * Default close policy: we start initiating the CHANNEL_CLOSE
33 * procedure as soon as both sides of the channel have seen EOF.
35 return sent_local_eof && rcvd_remote_eof;
38 bool chan_no_exit_status(Channel *chan, int status)
40 return false;
43 bool chan_no_exit_signal(
44 Channel *chan, ptrlen signame, bool core_dumped, ptrlen msg)
46 return false;
49 bool chan_no_exit_signal_numeric(
50 Channel *chan, int signum, bool core_dumped, ptrlen msg)
52 return false;
55 bool chan_no_run_shell(Channel *chan)
57 return false;
60 bool chan_no_run_command(Channel *chan, ptrlen command)
62 return false;
65 bool chan_no_run_subsystem(Channel *chan, ptrlen subsys)
67 return false;
70 bool chan_no_enable_x11_forwarding(
71 Channel *chan, bool oneshot, ptrlen authproto, ptrlen authdata,
72 unsigned screen_number)
74 return false;
77 bool chan_no_enable_agent_forwarding(Channel *chan)
79 return false;
82 bool chan_no_allocate_pty(
83 Channel *chan, ptrlen termtype, unsigned width, unsigned height,
84 unsigned pixwidth, unsigned pixheight, struct ssh_ttymodes modes)
86 return false;
89 bool chan_no_set_env(Channel *chan, ptrlen var, ptrlen value)
91 return false;
94 bool chan_no_send_break(Channel *chan, unsigned length)
96 return false;
99 bool chan_no_send_signal(Channel *chan, ptrlen signame)
101 return false;
104 bool chan_no_change_window_size(
105 Channel *chan, unsigned width, unsigned height,
106 unsigned pixwidth, unsigned pixheight)
108 return false;
111 void chan_no_request_response(Channel *chan, bool success)
113 unreachable("this channel type should never send a want-reply request");
116 /* ----------------------------------------------------------------------
117 * Other miscellaneous utility functions.
120 void free_rportfwd(struct ssh_rportfwd *rpf)
122 if (rpf) {
123 sfree(rpf->log_description);
124 sfree(rpf->shost);
125 sfree(rpf->dhost);
126 sfree(rpf);