re-mark 1.29b-2 as not yet uploaded (merge madness!)
[debian/tar] / tests / extrac09.at
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2
3 # Test suite for GNU tar.
4 # Copyright 2010, 2013-2014, 2016 Free Software Foundation, Inc.
5
6 # This file is part of GNU tar.
7
8 # GNU tar is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
12
13 # GNU tar is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17
18 # You should have received a copy of the GNU General Public License
19 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
21 # This attempts to cause xgetcwd() to fail, and then checks to see if
22 # such failure causes tar to abort even in a case where the results of
23 # the call aren't actually needed.
24 #
25 # (xgetcwd() may fail e.g. on Solaris 10 when "." or ".." are unreadable.
26 # On most systems xgetcwd() won't fail even in that situation, but
27 # on those systems this test will simply succeed without actually testing
28 # anything within tar.)
29 #
30 # http://lists.gnu.org/archive/html/bug-tar/2010-07/msg00045.html
31 #
32 # (See also 'listed03.at'.)
33
34 AT_SETUP([extracting even when . and .. are unreadable])
35 AT_KEYWORDS([extract extrac09])
36
37 AT_TAR_CHECK([
38 AT_UNPRIVILEGED_PREREQ
39
40 mkdir dir
41 mkdir dir/sub
42 mkdir dir/sub/extract
43 genfile --file dir/sub/f
44 cd dir/sub
45
46 tar -cf archive.tar f
47
48 chmod a-r . ..
49 tar -xvf archive.tar -C extract f
50 status=$?
51 chmod a+r . ..
52 cmp f extract/f || status=$?
53 exit $status
54 ],
55 [0],
56 [f
57 ],
58 [],[],[],[gnu])
59
60 AT_CLEANUP