From owner-dev-commits-src-main@freebsd.org Sun Apr 11 21:49:18 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 796B95DFCD7; Sun, 11 Apr 2021 21:49:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FJQW22zjVz4fTM; Sun, 11 Apr 2021 21:49:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 592EA3755; Sun, 11 Apr 2021 21:49:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13BLnIIZ067267; Sun, 11 Apr 2021 21:49:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13BLnI0I067266; Sun, 11 Apr 2021 21:49:18 GMT (envelope-from git) Date: Sun, 11 Apr 2021 21:49:18 GMT Message-Id: <202104112149.13BLnI0I067266@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Yuri Pankov Subject: git: 0cb61a320a70 - main - ee: restore the stdin/stdout terminal check MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuripv X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0cb61a320a7036f674f70e6487a5b0e44deb73b9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2021 21:49:18 -0000 The branch main has been updated by yuripv: URL: https://cgit.FreeBSD.org/src/commit/?id=0cb61a320a7036f674f70e6487a5b0e44deb73b9 commit 0cb61a320a7036f674f70e6487a5b0e44deb73b9 Author: Yuri Pankov AuthorDate: 2021-04-11 21:44:29 +0000 Commit: Yuri Pankov CommitDate: 2021-04-11 21:48:45 +0000 ee: restore the stdin/stdout terminal check This seems to have been lost during updates from upstream, and was reported (on IRC) as a nice feature to have (again). Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D28689 --- contrib/ee/ee.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contrib/ee/ee.c b/contrib/ee/ee.c index 70a44076f882..5706dba1a20f 100644 --- a/contrib/ee/ee.c +++ b/contrib/ee/ee.c @@ -554,6 +554,13 @@ char *argv[]; for (counter = 1; counter < 24; counter++) signal(counter, SIG_IGN); + /* Always read from (and write to) a terminal. */ + if (!isatty(STDIN_FILENO) || !isatty(STDOUT_FILENO)) { + fprintf(stderr, + "ee's standard input and output must be a terminal\n"); + exit(1); + } + signal(SIGCHLD, SIG_DFL); signal(SIGSEGV, SIG_DFL); signal(SIGINT, edit_abort);