summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/server-client.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2014-04-16 08:02:31 +0000
committernicm <nicm@openbsd.org>2014-04-16 08:02:31 +0000
commit9263e952cc8c7792e3f5f50af929f718e4b0b17a (patch)
tree2689aeb4d402f28d0177cc48176d7d4bf295c90c /usr.bin/tmux/server-client.c
parentsync with iked chap_ms.c (diff)
downloadwireguard-openbsd-9263e952cc8c7792e3f5f50af929f718e4b0b17a.tar.xz
wireguard-openbsd-9263e952cc8c7792e3f5f50af929f718e4b0b17a.zip
Because we pass the file descriptor from client to server, tmux can't
usefully work if stdin is /dev/tty. Complain about it more clearly.
Diffstat (limited to 'usr.bin/tmux/server-client.c')
-rw-r--r--usr.bin/tmux/server-client.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index d27c9ea3e20..73e061a1e80 100644
--- a/usr.bin/tmux/server-client.c
+++ b/usr.bin/tmux/server-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-client.c,v 1.119 2014/02/23 00:53:06 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.120 2014/04/16 08:02:31 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -119,6 +119,11 @@ server_client_open(struct client *c, char **cause)
if (c->flags & CLIENT_CONTROL)
return (0);
+ if (strcmp(c->ttyname, "/dev/tty") == 0) {
+ *cause = xstrdup("can't use /dev/tty");
+ return (-1);
+ }
+
if (!(c->flags & CLIENT_TERMINAL)) {
*cause = xstrdup("not a terminal");
return (-1);