From cd1693d3f953314178bc9c1ad75283ed29dc26ba Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Tue, 8 Nov 2016 05:31:01 +0000 Subject: Capsicumize some trivial stdio programs Trivially capsicumize some simple programs that just interact with stdio. This list of programs uses 'pledge("stdio")' in OpenBSD. No objection from: allanjude, emaste, oshogbo Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8307 --- usr.bin/yes/yes.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'usr.bin/yes') diff --git a/usr.bin/yes/yes.c b/usr.bin/yes/yes.c index ef98b4ded12d..2336d3f2c688 100644 --- a/usr.bin/yes/yes.c +++ b/usr.bin/yes/yes.c @@ -41,12 +41,17 @@ static const char rcsid[] = "$FreeBSD$"; #endif #endif /* not lint */ +#include #include #include int main(int argc, char **argv) { + + if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + if (argc > 1) while (puts(argv[1]) != EOF) ; -- cgit v1.2.3