util/spkmodem_recv: Use pledge but only on OpenBSD

It will only be used on OpenBSD. Other operating
systems will behave in the same way.

Pledge is feature specific to OpenBSD that
restricts system operations, for security:

https://man.openbsd.org/pledge.2

Signed-off-by: Leah Rowe <leah@libreboot.org>
fsdg20230625
Leah Rowe 2023-05-16 15:09:33 +01:00
parent 25241ae222
commit 5b59490928
1 changed files with 5 additions and 0 deletions

View File

@ -36,6 +36,11 @@ main(int argc, char *argv[])
{
int c;
#ifdef HAVE_PLEDGE
if (pledge("stdio", NULL) == -1)
err(errno, "pledge");
#endif
while ((c = getopt(argc, argv, "u")) != -1) {
switch (c) {
case 'u':