summaryrefslogtreecommitdiff
path: root/usr.bin/which/which.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/which/which.c')
-rw-r--r--usr.bin/which/which.c5
1 files changed, 4 insertions, 1 deletions
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 <Todd.Miller@courtesan.com>
@@ -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++;