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 */ string sFlag; /* search passages */
bool VFlag; /* show version */ bool VFlag; /* show version */
version (OpenBSD) {
immutable(char) *promises;
}
int int
main(string[] args) main(string[] args)
{ {
bool success; 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 { debug {
return run(args); return run(args) ? 0 : 1;
} }
try { try {