From 1bc050f6ced0f2f6a83be2d8983808890618edde Mon Sep 17 00:00:00 2001 From: deraadt Date: Sat, 10 Oct 2015 19:02:19 +0000 Subject: [PATCH] pledge "stdio rpath" ok beck doug --- usr.bin/which/which.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.bin/which/which.c b/usr.bin/which/which.c index 1f2bb65fe0b..3281a78c6d9 100644 --- a/usr.bin/which/which.c +++ b/usr.bin/which/which.c @@ -1,4 +1,4 @@ -/* $OpenBSD: which.c,v 1.20 2015/01/16 06:40:14 deraadt Exp $ */ +/* $OpenBSD: which.c,v 1.21 2015/10/10 19:02:19 deraadt Exp $ */ /* * Copyright (c) 1997 Todd C. Miller @@ -84,6 +84,9 @@ main(int argc, char *argv[]) if (setuid(geteuid())) err(1, "Can't set uid to %u", geteuid()); + if (pledge("stdio rpath", NULL) == -1) + err(1, "pledge"); + for (n = 0; n < argc; n++) if (findprog(argv[n], path, progmode, allmatches) == 0) notfound++; -- 2.20.1