$OpenBSD: patch-src_xzdec_xzdec_c,v 1.2 2016/08/12 20:52:26 naddy Exp $
--- src/xzdec/xzdec.c.orig	Tue Sep 29 12:57:36 2015
+++ src/xzdec/xzdec.c	Fri Aug 12 22:49:12 2016
@@ -292,9 +292,17 @@ main(int argc, char **argv)
 
 	if (optind == argc) {
 		// No filenames given, decode from stdin.
+		if (pledge("stdio", NULL) == -1) {
+			my_errorf("pledge");
+			exit(EXIT_FAILURE);
+		}
 		uncompress(&strm, stdin, "(stdin)");
 	} else {
 		// Loop through the filenames given on the command line.
+		if (pledge("stdio rpath", NULL) == -1) {
+			my_errorf("pledge");
+			exit(EXIT_FAILURE);
+		}
 		do {
 			// "-" indicates stdin.
 			if (strcmp(argv[optind], "-") == 0) {
