[cap-talk] Piping capability communication, data vs. descriptor capability strengths

John Carlson john.carlson3 at sbcglobal.net
Fri Feb 27 23:21:32 EST 2009


Wouldn't you have to create something in the ambient authority  
environment to get this to work?  What if another process owned by the  
same user was snooping on your PF_UNIX sockets?

I'd be interested in contribution to a C++ wrapper.  I've done a lot  
of TCP programming and a little UDP programming.  The only use of UNIX  
sockets that I recall was a way to write to the console input (behind  
locked doors in those days) on BSD 4.2 back in the mid '80s.

John

On Feb 27, 2009, at 7:06 AM, Rob Meijer wrote:

> On Fri, February 27, 2009 09:21, Jed Donnelley wrote:
>
>> Even in Unix I've heard that open file descriptors can be sent
>> through a pipe.  If that's so, what's the syntax (e.g. as above) look
>> like?  How are the descriptors sent and received specified (by the
>> sender on sending and by the OS on receiving to the receiver)?
>
>
> Datagram sockets of the PF_UNIX type can be used to communicate file
> descriptors using sendmsg/recvmsg. The man pages are a bit short on
> documentation on this, and the API requires you to use nasty MACRO's  
> in
> order to be portable, but if you can step past this, UNIX domain  
> sockets
> can be a great way to do IPC.
>
> I have been planning to write a C++ wrapper for it looking if  
> combining it
> with select and C++ functors could provide a more friendly  
> interface, but
> haven't gotten to more than a few partial experiments yet. This list  
> tends
> to be a bit hostile towards C/C++ as languages, but if anyone here is
> truly interested in this and willing to work on it with me, I may  
> pick it
> up again and see how far it gets us.
>
>
> Rob
>
> _______________________________________________
> cap-talk mailing list
> cap-talk at mail.eros-os.org
> http://www.eros-os.org/mailman/listinfo/cap-talk



More information about the cap-talk mailing list