On Wed, Jul 18, 2018 at 12:59:12PM +0100, Ricardo Mestre wrote:
> Are there any brave souls out there with unveil(2) enabled already?
> If yes please test this diff for spamlogd(8) which seems to only need rw
> access to the file PATH_SPAMD_DB and nothing else.
> Not asking for OKs yet, but if the code pattern is correct can I start looking
> at other programs?
mostly about the code pattern.
first, I didn't know all arcane of unveil, so I could be wrong at some
point. hearing from beck@ would help too :)
- pledge and unveil
I think, if possible, you should configure unveil(2) before calling
pledge(2). This way, you don't have to let the "unveil" promise
- locking unveil
You should call unveil(NULL, NULL) when all your unveil(2) stuff is
done: this way, you would lock further unveil addition. But with
pledge(2) call after, any unveil(2) call would abort the program
anyway (with no "unveil" promise).