summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortb <tb@openbsd.org>2016-01-03 14:43:20 +0000
committertb <tb@openbsd.org>2016-01-03 14:43:20 +0000
commitd508b11b66aceddc2a9cdf80369ab513d775e971 (patch)
tree2906c57bcba7a61bd7d52b4ad6696adbf304a602
parentAbout 13 years ago when the idiom srandom(time()), and sometimes (diff)
downloadwireguard-openbsd-d508b11b66aceddc2a9cdf80369ab513d775e971.tar.xz
wireguard-openbsd-d508b11b66aceddc2a9cdf80369ab513d775e971.zip
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 {