summaryrefslogtreecommitdiff
path: root/regress/bin
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2006-01-25 17:42:09 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2006-01-25 17:42:09 +0000
commita8177249d03774fb08a2b601a50d2ac83b18739b (patch)
tree245af51e84af0410d116198fb1e10b715a9d9289 /regress/bin
parent211c3d1b8162262bc685d158aa7aca08cacc1d0c (diff)
append without a file list should not corrupt a tar file;
report Rainer Giedat; ok millert@
Diffstat (limited to 'regress/bin')
-rw-r--r--regress/bin/pax/Makefile4
-rw-r--r--regress/bin/pax/t5.sh26
2 files changed, 28 insertions, 2 deletions
diff --git a/regress/bin/pax/Makefile b/regress/bin/pax/Makefile
index 3f90d56e9c6..7a362f82451 100644
--- a/regress/bin/pax/Makefile
+++ b/regress/bin/pax/Makefile
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.4 2005/06/13 19:22:02 otto Exp $
+# $OpenBSD: Makefile,v 1.5 2006/01/25 17:42:08 markus Exp $
-TESTSCRIPTS=t1 t2 t3 t4
+TESTSCRIPTS=t1 t2 t3 t4 t5
.for t in ${TESTSCRIPTS}
REGRESS_TARGETS+=t-${t}
diff --git a/regress/bin/pax/t5.sh b/regress/bin/pax/t5.sh
new file mode 100644
index 00000000000..48ec7edd2b8
--- /dev/null
+++ b/regress/bin/pax/t5.sh
@@ -0,0 +1,26 @@
+# $OpenBSD: t5.sh,v 1.1 2006/01/25 17:42:08 markus Exp $
+# append without a file list should not corrupt a tar file
+#
+OBJ=$2
+cd ${OBJ}
+fail () {
+ rm -f a b foo.tar
+ echo "$*"
+ exit 1
+}
+echo a > a
+echo b > b
+echo a | pax -w -f foo.tar
+tar tf foo.tar | grep -q a || fail missing file a
+# append without a file list
+echo -n | pax -w -a -f foo.tar
+tar tf foo.tar > /dev/null || fail not a tar file
+# again
+echo | pax -w -a -f foo.tar
+tar tf foo.tar > /dev/null || fail not a tar file
+# append file
+echo b | pax -w -a -f foo.tar
+for i in a b; do
+ tar tf foo.tar | grep -q $i || fail missing file $i
+done
+rm -f a b foo.tar