From owner-cvs-src@FreeBSD.ORG Wed Jan 21 20:24:17 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0086B16A4CE; Wed, 21 Jan 2004 20:24:17 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3145F43D2D; Wed, 21 Jan 2004 20:24:16 -0800 (PST) (envelope-from cperciva@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i0M4OG0B070600; Wed, 21 Jan 2004 20:24:16 -0800 (PST) (envelope-from cperciva@repoman.freebsd.org) Received: (from cperciva@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i0M4OF7S070599; Wed, 21 Jan 2004 20:24:15 -0800 (PST) (envelope-from cperciva) Message-Id: <200401220424.i0M4OF7S070599@repoman.freebsd.org> From: Colin Percival Date: Wed, 21 Jan 2004 20:24:15 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/usr.bin/lock lock.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2004 04:24:17 -0000 cperciva 2004/01/21 20:24:15 PST FreeBSD src repository Modified files: usr.bin/lock lock.c Log: Two fixes here: 1. If fgets fails, don't go into an infinite cpu-intensive loop. Instead, check to see if the terminal still exists, and sleep(1) otherwise. 2. When we check to see if the terminal still exists, make sure we're not mislead by EINTR. This could have been a security issue, but fortunately the current implementation of tcgetattr doesn't EINTR. PR: bin/60758 Approved by: rwatson (mentor) Revision Changes Path 1.18 +4 -2 src/usr.bin/lock/lock.c