summaryrefslogtreecommitdiff
path: root/usr.bin/lam
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2018-07-11 11:42:18 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2018-07-11 11:42:18 +0000
commit432aa1992d965f62727055afc39f518911efab76 (patch)
tree3c16295525bdd94826e21391819e2c2c91fbc532 /usr.bin/lam
parenta0dce727a52198aeed360e842fab656de822a048 (diff)
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@
Diffstat (limited to 'usr.bin/lam')
-rw-r--r--usr.bin/lam/lam.c6
1 files changed, 5 insertions, 1 deletions
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;