summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorVadim Zhukov <zhuk@cvs.openbsd.org>2013-03-27 17:14:11 +0000
committerVadim Zhukov <zhuk@cvs.openbsd.org>2013-03-27 17:14:11 +0000
commit05ae3cbcfa9a21c31e30a2d11d44274c80f40a1b (patch)
treec6657e801cabcef765d0bed1a9c9a2b7b2b978f5 /bin
parenteabedd8d1f25f5c01cb625778cec758dc8b347aa (diff)
Enable support for write_opt=nodir for ustar archives which helps to fix
issues with some crappy tar archive readers out there that rely on the fact that directory entries ends up with "/" when created by GNU Tar, and now I'm finishing this commit message by mentioning people who gave input and okays: deraadt@ millert@ jmc@
Diffstat (limited to 'bin')
-rw-r--r--bin/pax/options.c4
-rw-r--r--bin/pax/pax.110
-rw-r--r--bin/pax/tar.c8
3 files changed, 15 insertions, 7 deletions
diff --git a/bin/pax/options.c b/bin/pax/options.c
index 909a944ad5d..dcd1cf834a1 100644
--- a/bin/pax/options.c
+++ b/bin/pax/options.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options.c,v 1.76 2012/12/04 02:24:45 deraadt Exp $ */
+/* $OpenBSD: options.c,v 1.77 2013/03/27 17:14:10 zhuk Exp $ */
/* $NetBSD: options.c,v 1.6 1996/03/26 23:54:18 mrg Exp $ */
/*-
@@ -119,7 +119,7 @@ FSUB fsub[] = {
/* 5: POSIX USTAR */
{"ustar", 10240, BLKMULT, 0, 1, BLKMULT, 0, ustar_id, ustar_strd,
ustar_rd, tar_endrd, ustar_stwr, ustar_wr, tar_endwr, tar_trail,
- rd_wrfile, wr_rdfile, bad_opt},
+ rd_wrfile, wr_rdfile, tar_opt},
};
#define F_OCPIO 0 /* format when called as cpio -6 */
#define F_ACPIO 1 /* format when called as cpio -c */
diff --git a/bin/pax/pax.1 b/bin/pax/pax.1
index c5eca2c57e6..08c33d81dbc 100644
--- a/bin/pax/pax.1
+++ b/bin/pax/pax.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: pax.1,v 1.61 2010/09/19 20:55:25 jmc Exp $
+.\" $OpenBSD: pax.1,v 1.62 2013/03/27 17:14:10 zhuk Exp $
.\" $NetBSD: pax.1,v 1.3 1995/03/21 09:07:37 cgd Exp $
.\"
.\" Copyright (c) 1992 Keith Muller.
@@ -34,7 +34,7 @@
.\"
.\" @(#)pax.1 8.4 (Berkeley) 4/18/94
.\"
-.Dd $Mdocdate: September 19 2010 $
+.Dd $Mdocdate: March 27 2013 $
.Dt PAX 1
.Os
.Sh NAME
@@ -487,10 +487,12 @@ In general,
take the form:
.Ar name Ns = Ns Ar value .
.Pp
-The following options are available for the old
+The following options are available for the
+.Em ustar
+and old
.Bx
.Em tar
-format:
+formats:
.Pp
.Bl -tag -width Ds -compact
.It Cm nodir
diff --git a/bin/pax/tar.c b/bin/pax/tar.c
index 3cabd38691d..b52a1abb4c5 100644
--- a/bin/pax/tar.c
+++ b/bin/pax/tar.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tar.c,v 1.44 2012/12/04 02:24:45 deraadt Exp $ */
+/* $OpenBSD: tar.c,v 1.45 2013/03/27 17:14:10 zhuk Exp $ */
/* $NetBSD: tar.c,v 1.5 1995/03/21 09:07:49 cgd Exp $ */
/*-
@@ -914,6 +914,12 @@ ustar_wr(ARCHD *arcn)
}
/*
+ * user asked that dirs not be written to the archive
+ */
+ if (arcn->type == PAX_DIR && tar_nodir)
+ return (1);
+
+ /*
* check the length of the linkname
*/
if (((arcn->type == PAX_SLK) || (arcn->type == PAX_HLK) ||