Re: [BUG] Passing FDs over pipes

Richard Gooch (Richard.Gooch@atnf.CSIRO.AU)
Thu, 14 May 1998 17:24:58 +1000


David S. Miller writes:
> Date: Thu, 14 May 1998 13:48:42 +1000
> From: Richard Gooch <Richard.Gooch@atnf.CSIRO.AU>
>
> So where does it say that passing FDs over a pipe is a no-no?
>
> Nowhere does it say it's allowed either.

OK, but I hope you don't have an objection to allowing it :-)
It's a very handy feature.

> It's another one of those "undocumented behavior" deals, here is
> another one where Linux is different than everyone else yet the
> behavior is not documented in any vendors manpage let alone in the
> POSIX standards.
>
> 1) Create a UNIX socket
> 2) Bind the socket to the FS namespace as /tmp/mysock
> 3) Try fchown(sockfd, ...)
> 4) Try chown("/tmp/mysock", ...)
> 5) Try fchmod(sockfd, ...)
> 6) Try chmod("/tmp/mysock", ...)
>
> Compare and contrast on various systems vs. Linux.
>
> The BSD behaviors here are a consequence of their implementation of
> UNIX sockets and pipes, not on purpose. And this probably why none of
> it is documented anywhere.
>
> Linux has acted this way for these cases since day one, and it isn't
> changing for 2.2.x, maybe for 2.3.x when we merge in the sockets to be
> true VFS citizens.

OK, I can see that making Unix sockets true VFS citizens is a job for
2.3.x. But, more pressing for me, what about passing FDs over a pipe?
Is that easy enough to implement?

Regards,

Richard....

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu