]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r224865: tail: Fix crash if -F'ed file's filesystem disappears.
authorjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 21 Aug 2011 20:59:51 +0000 (20:59 +0000)
committerjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 21 Aug 2011 20:59:51 +0000 (20:59 +0000)
commit4ee8ea5ef8d23857959b42150fd2b6d34ab37ba0
tree727f1ca39e1c0aedfaab11a4fa6957478e921032
parente49555929f55e49d1fed667837a4a648694f6cc3
MFC r224865: tail: Fix crash if -F'ed file's filesystem disappears.

If tail notices that a file it is following no longer exists (because stat()
fails), it will output any final lines and then close the file. If the read
operation also causes an error, such as when the filesystem is forcefully
unmounted, it closes the file as well, leading to fclose(NULL) and a
segmentation fault.

PR: bin/159750

git-svn-id: svn://svn.freebsd.org/base/stable/8@225067 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
usr.bin/tail/forward.c