From: mestre Date: Fri, 20 Jul 2018 21:47:07 +0000 (+0000) Subject: add pledge(2), it only needs rpath if reading from a file X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2a384edf8af72b3e44964db0e1a859558de39196;p=openbsd add pledge(2), it only needs rpath if reading from a file hint from tb@ and OK ratchov@ --- diff --git a/usr.bin/midiplay/midiplay.c b/usr.bin/midiplay/midiplay.c index ab400fdfad8..4eb79515494 100644 --- a/usr.bin/midiplay/midiplay.c +++ b/usr.bin/midiplay/midiplay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: midiplay.c,v 1.20 2018/07/20 21:44:41 mestre Exp $ */ +/* $OpenBSD: midiplay.c,v 1.21 2018/07/20 21:47:07 mestre Exp $ */ /* $NetBSD: midiplay.c,v 1.8 1998/11/25 22:17:07 augustss Exp $ */ /* @@ -463,6 +463,14 @@ main(int argc, char **argv) if (setitimer(ITIMER_REAL, &it, NULL) < 0) err(1, "setitimer"); + if (example || argc == 0) { + if (pledge("stdio", NULL) == -1) + err(1, "pledge"); + } else { + if (pledge("stdio rpath", NULL) == -1) + err(1, "pledge"); + } + if (example) playdata(sample, sizeof sample, ""); else if (argc == 0)