Add call to pledge() on OpenBSD

This commit is contained in:
Jeremy Baxter 2023-12-14 19:54:57 +13:00
parent 1c9bb056e8
commit aecbdfec4f

14
esv.d
View file

@ -48,13 +48,25 @@ bool rFlag, RFlag; /* passage references */
string sFlag; /* search passages */
bool VFlag; /* show version */
version (OpenBSD) {
immutable(char) *promises;
}
int
main(string[] args)
{
bool success;
version (OpenBSD) {
import core.sys.openbsd.unistd : pledge;
import std.string : toStringz;
promises = toStringz("stdio rpath wpath cpath inet dns proc exec prot_exec");
pledge(promises, null);
}
debug {
return run(args);
return run(args) ? 0 : 1;
}
try {