summaryrefslogtreecommitdiff
path: root/usr.bin/which/which.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-10 19:02:20 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-10 19:02:20 +0000
commita091a29f4133de7c5b65d652343c83e3a4b6e14d (patch)
tree6a6ae842f29a2c6f7521dd5e6c3615e1444fdf25 /usr.bin/which/which.c
parent11abec2e94d6e8c4fe21fbf69e4a7aa125f3f1c9 (diff)
pledge "stdio rpath"
ok beck doug
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++;