Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
File descriptor passing: is this of any interest/being worked on? #11417
The last couple of years there has been a lot of interest in the area of capability systems for UNIX-like operating systems. Examples include FreeBSD's Capsicum, and CloudABI, a project I'm heavily involved in.
One of the important requirements for capability systems is that capabilities (in the case of Capsicum/etc: file descriptors) can be sent across processes. For example, it is possible to design a secure mailserver that can only access mailboxes stored on disk by sending an RPC to a privileged helper process to request a file descriptor for a specific user's mailbox file/directory. On most UNIX-like systems, file descriptors can be transmitted to different processes across UNIX sockets, using
It looks like Protobuf/GRPC doesn't support this right now. First of all, Protobuf would need to be extended to have file descriptors as first-class data types. Second, GRPC should probably gain support for transmitting/receiving file descriptors across sockets. It should also gain features to properly manage the lifetime of file descriptors that are being transmitted/received.
The reason I'm getting in touch is because I'm interested in knowing whether the GRPC community is interested in having support for such a feature integrated. I'm interested in working on this, but it would be a shame if that work would all be for nothing if the project considers it out of scope.
We have no plans to support anything like this directly in gRPC. However, note in C++, you can obtain a file descriptor yourself and use