The kdbuswreck
The kdbuswreck
Posted Apr 25, 2015 0:08 UTC (Sat) by kentonv (subscriber, #92073)In reply to: The kdbuswreck by cesarb
Parent article: The kdbuswreck
I think putting capabilities in a separate table would actually be a step backwards, in that all the existing tools that work with FDs would not work with these. That means you couldn't manipulate them in bash, you couldn't pass them over unix domain sockets, etc.
Posted Apr 25, 2015 0:52 UTC (Sat)
by cesarb (subscriber, #6266)
[Link]
They are still FDs, just stashed away in a "shadow" table. They could be easily passed over unix domain sockets (dup3 to the normal table, send it over, and close the copy in the normal table).
I agree that hiding them makes them impossible to manipulate with unmodified tools like bash, but that's sort of the point of the thought experiment: a way to add capability FDs without interfering with anything which doesn't use them, thus allowing for gradual introduction of the feature. It's only a thought experiment, after all.
There's precedent for that sort of trickery: I recall seeing some discussion here on LWN about a way to allow libraries to open FDs without interfering with or being interfered by the application (IIRC, the proposal was to stash them as directly-allocated high-numbered FDs, instead of using the lowest available slot).
The kdbuswreck