summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Hogan <doug@cvs.openbsd.org>2015-10-13 07:03:27 +0000
committerDoug Hogan <doug@cvs.openbsd.org>2015-10-13 07:03:27 +0000
commit1d64880ffde0545289fc5dc170fbff0046e085b7 (patch)
treeed43635a8ab9f0ea5eece7d451807977b43d586a
parent307da0b68c33ddfbd603e3616b61dbd0569f34b4 (diff)
Obvious pledge "stdio" for yes.
ok deraadt@
-rw-r--r--usr.bin/yes/yes.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/yes/yes.c b/usr.bin/yes/yes.c
index b7bf70e0ee5..023fefc4bad 100644
--- a/usr.bin/yes/yes.c
+++ b/usr.bin/yes/yes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yes.c,v 1.8 2009/10/27 23:59:50 deraadt Exp $ */
+/* $OpenBSD: yes.c,v 1.9 2015/10/13 07:03:26 doug Exp $ */
/* $NetBSD: yes.c,v 1.3 1994/11/14 04:56:15 jtc Exp $ */
/*
@@ -30,11 +30,16 @@
* SUCH DAMAGE.
*/
+#include <err.h>
#include <stdio.h>
+#include <unistd.h>
int
main(int argc, char *argv[])
{
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
+
if (argc > 1)
for (;;)
puts(argv[1]);