Pass an open socket to another process????

Chris Torek chris at trantor.umd.edu
Fri Feb 12 14:29:51 AEST 1988


In article <22952 at ucbvax.BERKELEY.EDU> sklower at sequoia.Berkeley.EDU.UUCP
								    ----?
(Keith Sklower) writes:

>4.2 and 4.3 BSD provide a means of passing an open file descriptor
>of any sort (including sockets) between two co-operating processes
>by means of the sendmsg system call.

Beware, however, of some rather serious bugs in the implementation
in 4.2BSD.  For instance, using MSG_PEEK with recvmsg() on a message
with rights can cause multiple acceptance of the passed file
descriptor, resulting in eventual file system corruption (without
the closef firewall) or a panic (with the firewall).

All of this is fixed in 4.3BSD (with the possible exception of the
fd garbage collection code---try not to send pipe descriptors to
yourself over those pipe descriptors, please).  Which SunOS releases
may have which bugs I cannot say.
-- 
In-Real-Life: Chris Torek, Univ of MD Computer Science, +1 301 454 7163
(hiding out on trantor.umd.edu until mimsy is reassembled in its new home)
Domain: chris at mimsy.umd.edu		Path: not easily reachable



More information about the Comp.unix.questions mailing list