Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Q about <(...)



On Apr 3, 11:11am, Andrej Borsenkow wrote:
} Subject: Q about <(...)
}
} pkgadd: ERROR: attempt to process datastream failed
}     - open of </dev/fd/11> failed, errno=9
} 
} Manual states, that <(...) creates a FIFO and passes it's name as
} argument ... obviously, it is not the case - it is simply passing opened
} file descriptor.

Not true, exactly:

zagzig[21] /bin/echo <(: foo)
/proc/self/fd/11

Zsh is over-optimizing a bit in this case; because PATH_DEV_FD was defined
at compile time, zsh simply uses that existing file name instead of making
its own new FIFO.

} As all files are closed by sudo this fails.

That's the unfortunate bit.  Zsh is making an unwarranted assumption that
the file descriptor it opened will still be open by the time the file
name is referenced.

For guaranteed correct operation, we should remove the PATH_DEV_FD code
from getproc() in exec.c, or (perhaps better) change it to be used only
if mkfifo() is absent or fails.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author