aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2010-09-05 16:16:46 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2010-09-05 16:16:46 +0200
commit8d789e419732e860cf89883c0565ff496b3291ee (patch)
tree15840221629b181993caa13977cd91ce776cd184
parent6957d79bd67efce80f9dec4e1936ea605efb7263 (diff)
downloadbusybox-w32-8d789e419732e860cf89883c0565ff496b3291ee.tar.gz
busybox-w32-8d789e419732e860cf89883c0565ff496b3291ee.tar.bz2
busybox-w32-8d789e419732e860cf89883c0565ff496b3291ee.zip
tar: add a test for extraction of read-only directory
Signed-off-by: Dan Fandrich <dan@coneharvesters.com> Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
-rwxr-xr-xtestsuite/tar.tests25
1 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/tar.tests b/testsuite/tar.tests
index c2d3b3df3..dd502c23d 100755
--- a/testsuite/tar.tests
+++ b/testsuite/tar.tests
@@ -129,6 +129,31 @@ Ok
129"Ok\n" "" 129"Ok\n" ""
130SKIP= 130SKIP=
131 131
132# Needs to be run under non-root for meaningful test
133optional FEATURE_TAR_CREATE
134testing "tar writing into read-only dir" '\
135rm -rf input_* test.tar 2>/dev/null
136mkdir input_dir
137>input_dir/input_file
138chmod 550 input_dir
139tar cf test.tar input_dir
140tar tvf test.tar | sed "s/.*[0-9] input/input/"
141chmod 770 input_dir
142rm -rf input_*
143tar xf test.tar 2>&1
144echo Ok: $?
145ls -l input_dir/* . | grep input_ | sed "s/\\(^[^ ]*\\) .* input/\\1 input/"
146chmod 770 input_dir
147' "\
148input_dir/
149input_dir/input_file
150Ok: 0
151-rw-r--r-- input_dir/input_file
152dr-xr-x--- input_dir
153" \
154"" ""
155SKIP=
156
132cd .. && rm -rf tar.tempdir || exit 1 157cd .. && rm -rf tar.tempdir || exit 1
133 158
134exit $FAILCOUNT 159exit $FAILCOUNT