Re:Support of OpenBSD pledge(2) in programming languages
by heinrich5991 on Saturday April 09, 2016 @06:08PM
(#11463578)
From the quoted text I'd understand it's the `exec` that resets the pledge.
[ Parent
| on HN ]
Re:Support of OpenBSD pledge(2) in programming languages
by umanwizard on Saturday April 09, 2016 @07:29PM
(#11463947)
I installed OpenBSD so I could check this out. tl;dr, you were right.
$ cat testpledge.c
#include <unistd.h>
#include <stdio.h>
int main()
{
pledge("proc exec", NULL);
execl("/bin/echo", "echo", "asdf", NULL);
_exit(0);
}
$ cc testpledge.c
$ ./a.out
asdf