$OpenBSD: patch-src_xzdec_xzdec_c,v 1.1 2016/01/17 20:28:36 naddy Exp $
--- src/xzdec/xzdec.c.orig	Thu Feb 26 15:54:33 2015
+++ src/xzdec/xzdec.c	Sun Oct 18 13:27:51 2015
@@ -292,9 +292,21 @@ main(int argc, char **argv)
 
 	if (optind == argc) {
 		// No filenames given, decode from stdin.
+#ifdef __OpenBSD__
+		if (pledge("stdio", NULL) == -1) {
+			my_errorf("pledge");
+			exit(EXIT_FAILURE);
+		}
+#endif
 		uncompress(&strm, stdin, "(stdin)");
 	} else {
 		// Loop through the filenames given on the command line.
+#ifdef __OpenBSD__
+		if (pledge("stdio rpath", NULL) == -1) {
+			my_errorf("pledge");
+			exit(EXIT_FAILURE);
+		}
+#endif
 		do {
 			// "-" indicates stdin.
 			if (strcmp(argv[optind], "-") == 0) {
