Bug 16316

Summary: Enhancement: allow .fakeid to be a named pipe
Product: Base System Reporter: Seth <seth>
Component: binAssignee: dwmalone
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.4-STABLE   
Hardware: Any   
OS: Any   

Description Seth 2000-01-23 19:40:01 UTC
	builtins.c checks to see whether .fakeid is a regular file and
won't touch it if it's not.  It would be great to use a named pipe here
so that random words could be inserted via the following (demo) script:


#!/bin/sh

fakeid=/home/user/.fakeid

rm -f $fakeid
mkfifo $fakeid
while [ 1 ]; do
  /usr/games/random 50000 < /usr/share/dict/words | head -1 > $fakeid
done

Fix: 

is the S_ISREG test absolutely necessary?  Can we add a check for pipes
  and allow them?  Would this introduce security risks?
How-To-Repeat: 
  Try making .fakeid a named pipe... doesn't work.
Comment 1 dwmalone freebsd_committer freebsd_triage 2002-01-23 09:48:23 UTC
Responsible Changed
From-To: freebsd-bugs->dwmalone

Inetd is my problem.
Comment 2 Robert Watson freebsd_committer freebsd_triage 2005-09-17 20:51:48 UTC
State Changed
From-To: open->closed


The S_ISREG check was actually specifically added to avoid allowing fifos 
to be hooked up to the back end of .fakeid.  Specifically, so that if the 
user program at the other end of the fifo wedged or exited, it would not 
block the inetd session.  In theory you could use O_NOBLOCK and 
non-blocking I/O, but this also comes with its risks.