usefully work if stdin is /dev/tty. Complain about it more clearly.
-/* $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>
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);