summaryrefslogtreecommitdiff
path: root/bin/pax/pax.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/pax/pax.c')
-rw-r--r--bin/pax/pax.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/pax/pax.c b/bin/pax/pax.c
index cd5fcd69021..f86ba6d7ceb 100644
--- a/bin/pax/pax.c
+++ b/bin/pax/pax.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pax.c,v 1.54 2023/07/05 18:45:14 guenther Exp $ */
+/* $OpenBSD: pax.c,v 1.55 2023/10/15 09:49:57 kn Exp $ */
/* $NetBSD: pax.c,v 1.5 1996/03/26 23:54:20 mrg Exp $ */
/*-
@@ -271,15 +271,15 @@ main(int argc, char **argv)
* so can't pledge at all then.
*/
if (pmode == 0 || (act != EXTRACT && act != COPY)) {
- if (pledge("stdio rpath wpath cpath fattr dpath getpw proc exec tape",
- NULL) == -1)
- err(1, "pledge");
-
/* Copy mode, or no gzip -- don't need to fork/exec. */
if (gzip_program == NULL || act == COPY) {
if (pledge("stdio rpath wpath cpath fattr dpath getpw tape",
NULL) == -1)
err(1, "pledge");
+ } else {
+ if (pledge("stdio rpath wpath cpath fattr dpath getpw proc exec tape",
+ NULL) == -1)
+ err(1, "pledge");
}
}