From: schwarze Date: Wed, 11 Jul 2018 11:42:17 +0000 (+0000) Subject: After opening all the needed files, tighten the pledge(2) X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=5117cd2872e582a1233cdfaea7760eb050235d5c;p=openbsd After opening all the needed files, tighten the pledge(2) from "stdio rpath" to just "stdio", before parsing any user data. It may not matter that much just yet, but parsing will become slightly more complicated soon when i shall add UTF-8 handling. OK millert@ --- diff --git a/usr.bin/lam/lam.c b/usr.bin/lam/lam.c index c7bac5bd7cd..1e169eff265 100644 --- a/usr.bin/lam/lam.c +++ b/usr.bin/lam/lam.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lam.c,v 1.20 2018/07/11 11:35:06 schwarze Exp $ */ +/* $OpenBSD: lam.c,v 1.21 2018/07/11 11:42:17 schwarze Exp $ */ /* $NetBSD: lam.c,v 1.2 1994/11/14 20:27:42 jtc Exp $ */ /*- @@ -78,6 +78,10 @@ main(int argc, char *argv[]) getargs(argc, argv); if (numfiles == 0) usage(); + + if (pledge("stdio", NULL) == -1) + err(1, "pledge"); + /* Concatenate lines from each file, then print. */ for (;;) { linep = line;