Vulnerability Development mailing list archives
Re: tail -f to a dir
From: klmitch () MIT EDU (Kev)
Date: Thu, 13 Jul 2000 09:44:09 -0400
I do not remember this being mentioned, but if it has sorry. I was playing today and I did a "tail -f /home/mydir" on RH 6.2 and I get: tail: /home/mydir: Is a directory tail: tail.c:718: recheck: Assertion `valid_file_spec (f)' failed. Abort (core dumped) Sometimes I get a core, sometimes not. Same result as root, but always = creates a core as root though.
hmmm...Linux won't allow directories to be opened with open(), and returns the error EISDIR. It seems that tail fails to stop after that, and has an assertion failure...while this would be a bug, there shouldn't be any way to use it...
So I tried this on my SGI running IRIX 6.55 and it went back to a prompt = like nothing happened.
I forget what IRIX does when you open() a dir...
Then I tried it on Solaris 2.6 and it actually spit the contents of the = dir. in binary form, but when it was done - it went back to a prompt.
Solaris allows opening directories and returns the contents of the directory on subsequent reads, just as you've discovered ;)
Any insight other than don't tail a directory?
HTH... -- Kevin L. Mitchell <klmitch () mit edu>
Current thread:
- tail -f to a dir Dino Amato (Jul 12)
- Re: tail -f to a dir Jon Paul, Nollmann (Jul 12)
- Re: tail -f to a dir spider () SECLAB COM (Jul 13)
- Re: tail -f to a dir Kev (Jul 13)