Hacker News new | ask | show | jobs
by heinrich5991 3716 days ago
From the quoted text I'd understand it's the `exec` that resets the pledge.
1 comments

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