Re: [BUG] Passing FDs over pipes

David S. Miller (davem@dm.cobaltmicro.com)
Wed, 13 May 1998 23:38:44 -0700


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.

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.

Later,
David S. Miller
davem@dm.cobaltmicro.com

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