4 ms·
In section 5.2 of Bernstein's paper, he discusses isolating single-source transformations. His example is locking down jpegtopnm using standard Unix mechanisms
by mhandley 9y ago
In section 5.2 of Bernstein's paper, he discusses isolating single-source transformations. His example is locking down jpegtopnm using standard Unix mechanisms so it can only read stdin and write stdout and do absolutely nothing else. It seems this pattern really should be one that is trivial for the programmer to use, without having to go through the process of managing a pool of UIDs, remember about setting process limits, etc. Then it might be used correctly more often. Would be a useful building block for lots of code, especially if it were portable across many versions of *nix.
- cperciva 9y agoThis is basically what Capsicum (FreeBSD + Linux) and pledge (OpenBSD) are for. I agree that it would be nice to have a standard interface, but the functionality provided by those is sufficiently different that it's hard to imagine how a single API could be created which usefully covers both.
- bringtheaction 9y agoSpeaking of which, anyone have examples of how to restrict a process to using stdin and stdout only with Capsicum and pledge?