Re:Support of OpenBSD pledge(2) in programming languages
by umanwizard on Saturday April 09, 2016 @05:56PM
(#11463541)
That's not clear, though. "The new program" it talks about is after running fork and exec, not just exec. It doesn't specify which call resets the pledge.
[ Parent
| on HN ]
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.
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
Re:Support of OpenBSD pledge(2) in programming languages
by gpvos on Sunday April 10, 2016 @06:28AM
(#11465650)
After fork, the original program is still running. The text specifically refers to the proc promise, which allows fork. It may be tersely formulated, but I really don't see how you could interpret this text otherwise.