summaryrefslogtreecommitdiff
path: root/bin/pax/tar.c
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/pax/tar.c
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/pax/tar.c')
-rw-r--r--bin/pax/tar.c8
1 files changed, 7 insertions, 1 deletions
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) ||