summaryrefslogtreecommitdiffstats
path: root/server-client.c
diff options
context:
space:
mode:
Diffstat (limited to 'server-client.c')
-rw-r--r--server-client.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/server-client.c b/server-client.c
index 34217a61..8b972c90 100644
--- a/server-client.c
+++ b/server-client.c
@@ -108,6 +108,9 @@ server_client_open(struct client *c, struct session *s, char **cause)
struct options *oo = s != NULL ? &s->options : &global_s_options;
char *overrides;
+ if (c->flags & CLIENT_CONTROL)
+ return (0);
+
if (!(c->flags & CLIENT_TERMINAL)) {
*cause = xstrdup ("not a terminal");
return (-1);
@@ -894,6 +897,17 @@ server_client_msg_identify(
if (*data->cwd != '\0')
c->cwd = xstrdup(data->cwd);
+ if (data->flags & IDENTIFY_CONTROL) {
+ c->stdin_callback = control_callback;
+ c->flags |= (CLIENT_CONTROL|CLIENT_SUSPENDED);
+
+ c->tty.fd = -1;
+ c->tty.log_fd = -1;
+
+ close(fd);
+ return;
+ }
+
if (!isatty(fd))
return;
data->term[(sizeof data->term) - 1] = '\0';