Re: IDEA: Process-Special files

Riley Williams (rhw@bigfoot.com)
Tue, 20 Oct 1998 14:40:27 +0100 (GMT)


Hi there.

>> This is a file that, when open()ed for read (O_RDONLY, O_RDWR,
>> etc) would be executed as a binary or script, and the output would
>> be substituted for the file.

> There's a nice trick with named pipes that is sometimes used
> to dynamically generate .plan files (whose contents are retrieved
> when you finger someone).

> I believe it goes like this:

> 1) mkfifo .specialfile
> 2) while true; do echo "This could be anything" > .specialfile; done
> 3) (someone else) cat .specialfile
> -> This could be anything

> Since no one has the pipe open for reading, the echo process will
> be suspended until a reader process comes along. At that point, the
> echo process will be awakened, thereby putting some contents in the
> pipe. When the reader process finishes, the next echo process will be
> launched and suspended again.

Related to the above is a simple trick to lock up a system...

ln -s /proc/kcore ~/.plan

or even

ln -s /dev/zero ~/.plan

Next time somebody fingers you...

Best wishes from Riley.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/