From owner-freebsd-bugs Mon Jun 26 22:50: 7 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id E98F837BE30 for ; Mon, 26 Jun 2000 22:50:04 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id WAA84930; Mon, 26 Jun 2000 22:50:04 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Mon, 26 Jun 2000 22:50:04 -0700 (PDT) Message-Id: <200006270550.WAA84930@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Kelly Yancey Subject: Re: bin/19514: patch to prevent tail'ing directories Reply-To: Kelly Yancey Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/19514; it has been noted by GNATS. From: Kelly Yancey To: freebsd-gnats-submit@FreeBSD.org Cc: Subject: Re: bin/19514: patch to prevent tail'ing directories Date: Mon, 26 Jun 2000 22:43:10 -0700 (PDT) Attached is a more correct patch, please apply it instead. Thanks, Kelly Index: usr.bin/tail/tail.c =================================================================== RCS file: /home/cvs/src/usr.bin/tail/tail.c,v retrieving revision 1.6 diff -u -r1.6 tail.c --- usr.bin/tail/tail.c 1999/07/04 17:26:03 1.6 +++ usr.bin/tail/tail.c 2000/06/27 05:37:31 @@ -171,6 +171,16 @@ ierr(); continue; } + if (S_ISDIR(sb.st_mode)) + errx(1, "%s is a directory", fname); + if (S_ISLNK(sb.st_mode)) + /* This should transparently be resolved and + * thus never happen. + */ + errx(1, "%s is a symlink", fname); + if (S_ISWHT(sb.st_mode)) + /* This should never happen. */ + errx(1, "%s is a whiteout entry", fname); if (argc > 1) { (void)printf("%s==> %s <==\n", first ? "" : "\n", fname); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message