Various formatting fixes
[tar.git] / tests / extrac09.at
blob09705f803b95e0448d81ab3ab62a0de195e2ccab
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
3 # Test suite for GNU tar.
4 # Copyright 2010-2024 Free Software Foundation, Inc.
6 # This file is part of GNU tar.
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.
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.
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/>.
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.
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.)
30 # http://lists.gnu.org/archive/html/bug-tar/2010-07/msg00045.html
32 # (See also 'listed03.at'.)
34 AT_SETUP([extracting even when . and .. are unreadable])
35 AT_KEYWORDS([extract extrac09 chdir])
37 AT_TAR_CHECK([
38 AT_UNPRIVILEGED_PREREQ
40 mkdir dir
41 mkdir dir/sub
42 mkdir dir/sub/extract
43 genfile --file dir/sub/f
44 cd dir/sub
46 tar -cf archive.tar f
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
55 [0],
58 [],[],[],[gnu])
60 AT_CLEANUP