Date: Mon, 26 Jun 2000 22:50:04 -0700 (PDT) From: Kelly Yancey <kbyanc@posi.net> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/19514: patch to prevent tail'ing directories Message-ID: <200006270550.WAA84930@freefall.freebsd.org>
index | next in thread | raw e-mail
The following reply was made to PR bin/19514; it has been noted by GNATS.
From: Kelly Yancey <kbyanc@posi.net>
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
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200006270550.WAA84930>
