1
0
mirror of https://github.com/tmate-io/tmate-ssh-server.git synced 2020-11-18 19:53:51 -08:00

Prevent jobs from running

Fixes #25
This commit is contained in:
Nicolas Viennot 2016-06-16 00:19:16 -04:00
parent 033298c42c
commit 0049a585b3
3 changed files with 13 additions and 2 deletions

6
job.c
View File

@ -49,6 +49,10 @@ job_run(const char *cmd, struct session *s, const char *cwd,
int nullfd, out[2];
const char *home;
#ifdef TMATE_SLAVE
return NULL;
#endif
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, out) != 0)
return (NULL);
@ -65,9 +69,7 @@ job_run(const char *cmd, struct session *s, const char *cwd,
close(out[1]);
return (NULL);
case 0: /* child */
#ifndef TMATE_SLAVE
clear_signals(1);
#endif
if (cwd == NULL || chdir(cwd) != 0) {
if ((home = find_home()) == NULL || chdir(home) != 0)

View File

@ -530,6 +530,10 @@ status_print(struct client *c, struct winlink *wl, time_t t,
const char *fmt;
char *text;
#ifdef TMATE_SLAVE
/* TODO use the host winlink status */
#endif
style_apply_update(gc, oo, "window-status-style");
fmt = options_get_string(oo, "window-status-format");
if (wl == s->curw) {

View File

@ -1407,6 +1407,11 @@ window_copy_copy_pipe(struct window_pane *wp, struct session *sess,
struct format_tree *ft;
char *expanded;
#ifdef TMATE_SLAVE
/* that job_run() is not going to end well */
return;
#endif
buf = window_copy_get_selection(wp, &len);
if (buf == NULL)
return;