summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <tb@cvs.openbsd.org>2016-01-03 14:43:21 +0000
committertb <tb@cvs.openbsd.org>2016-01-03 14:43:21 +0000
commit5a831ceb7cf6670aba9976bde23f2921d54ffa26 (patch)
treede17fa5db471ee48f8c3500a1f462c9ac7eb24e2
parentd9acce1f8555317f19d4bc565896a366a2dc64df (diff)
Add missing pledge "getpw". If -s or -o were specified on the command
line and the `remote file name' is subject to `tilde expansion', a call to getpwnam(3) happens. ok semarie@
-rw-r--r--usr.bin/uudecode/uudecode.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/uudecode/uudecode.c b/usr.bin/uudecode/uudecode.c
index a442fa9cac1..4ab7b241220 100644
--- a/usr.bin/uudecode/uudecode.c
+++ b/usr.bin/uudecode/uudecode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uudecode.c,v 1.22 2015/10/09 01:37:09 deraadt Exp $ */
+/* $OpenBSD: uudecode.c,v 1.23 2016/01/03 14:43:20 tb Exp $ */
/* $FreeBSD: uudecode.c,v 1.49 2003/05/03 19:44:46 obrien Exp $ */
/*-
@@ -126,7 +126,10 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- if (oflag || pflag == 0) {
+ if (sflag) {
+ if (pledge("stdio rpath wpath cpath getpw", NULL) == -1)
+ err(1, "pledge");
+ } else if (pflag == 0) {
if (pledge("stdio rpath wpath cpath", NULL) == -1)
err(1, "pledge");
} else {