AF_UNIX status report
Ken Brown
kbrown@cornell.edu
Sun Nov 22 20:44:19 GMT 2020
On 11/18/2020 3:34 AM, Corinna Vinschen wrote:
> On Nov 17 14:57, Ken Brown via Cygwin-developers wrote:
>> On 11/9/2020 4:08 AM, Corinna Vinschen wrote:
>>> The duplicated handle has to be closed at one point but otherwise
>>> the approach makes sense.
>>
>> After wasting a ridiculous amount of time because of careless mistakes with
>> handle duplication, I've finally gotten something working (currently for
>> disk files only and with some limitations that have to removed). I've
>> pushed it to the topic/af_unix branch in case you want to review it and/or
>> test it.
>
> This is soooo fantastic! Apart from files, the nexst most interesting
> case is sharing a socket, probably. We could activcate the 2nd half of
> privilege separation in sshd then.
I've pushed a first attempt to implement sending socket descriptors, but I
haven't yet tested it. I'll try to find a small test program and then, if all
goes well, take a look at sshd.
>> If you do test it, the main limitation currently is that the sending process
>> can't exit until the receiving process has received and processed the
>> SCM_RIGHTS data.
>
> While this is strictly a flaw, that may not be much of a limitation.
> It would be interesting to know how many applications send descriptors
> just to exit immediately. Not so many, probably.
I don't know, but I've reduced the effect of the limitation. Now the sending
process waits up to about 100ms for an ack from the receiving process before
closing the socket. I have no idea if 100ms is reasonable in the real world,
but it's big enough for my test programs and small enough that I don't notice
the delay when I run the programs interactively.
Ken
More information about the Cygwin-developers
mailing list