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
parent
25241ae222
commit
5b59490928
|
@ -36,6 +36,11 @@ main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
|
#ifdef HAVE_PLEDGE
|
||||||
|
if (pledge("stdio", NULL) == -1)
|
||||||
|
err(errno, "pledge");
|
||||||
|
#endif
|
||||||
|
|
||||||
while ((c = getopt(argc, argv, "u")) != -1) {
|
while ((c = getopt(argc, argv, "u")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'u':
|
case 'u':
|
||||||
|
|
Loading…
Reference in New Issue