Update copyright years
[tar.git] / tests / extrac21.at
blobcc8dd6203dfa94069719ead592e4526ad70b7134
1 # Test suite for GNU tar.                             -*- Autotest -*-
2 # Copyright 2017-2022 Free Software Foundation, Inc.
4 # This file is part of GNU tar.
6 # GNU tar is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # GNU tar is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 # When called with the --delay-directory-restore option, tar would
20 # in some cases restore the directory permissions too early, before
21 # attempting to replace softlink placeholders with the actual link.
22 # This caused failure if the permissions forbade writing.
24 # The bug was caused by incorrect assumption about delayed_set_stat
25 # ordering in create_placeholder_file.
27 # Reported by: Giuseppe Scrivano <gscrivano@gnu.org>
28 # References: <878tfa17ti.fsf@redhat.com>,
29 #    <http://lists.gnu.org/archive/html/bug-tar/2017-11/msg00009.html>
31 AT_SETUP([delay-directory-restore])
32 AT_KEYWORDS([extract extract21 read-only symlink delay-directory-restore])
33 AT_TAR_CHECK([
34 AT_UNPRIVILEGED_PREREQ
36 mkdir a a/b a/c
37 genfile --file a/b/D
38 genfile --file a/c/A
39 cd a/b
40 ln -sf ../c/A
41 cd ../..
42 chmod a-w a/b
43 tar --no-recurs -c -f A.tar a a/b a/b/D a/c a/b/A a/c/A
44 mkdir out
45 tar -C out -v -x -f A.tar --delay-directory-restore
47 [0],
48 [a/
49 a/b/
50 a/b/D
51 a/c/
52 a/b/A
53 a/c/A
55 [],[],[],[ustar]) # Testing one format is enough
57 AT_CLEANUP