Debian Codegraph @

tests/extrac21.at

raw
1 # Test suite for GNU tar. -*- Autotest -*-
2 # Copyright 2017-2023 Free Software Foundation, Inc.
3 #
4 # This file is part of GNU tar.
5 #
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.
10 #
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.
15 #
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/>.
18
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.
23 #
24 # The bug was caused by incorrect assumption about delayed_set_stat
25 # ordering in create_placeholder_file.
26 #
27 # Reported by: Giuseppe Scrivano <[email protected]>
28 # References: <[email protected]>,
29 # <http://lists.gnu.org/archive/html/bug-tar/2017-11/msg00009.html>
30
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
35
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
46 ],
47 [0],
48 [a/
49 a/b/
50 a/b/D
51 a/c/
52 a/b/A
53 a/c/A
54 ],
55 [],[],[],[ustar]) # Testing one format is enough
56
57 AT_CLEANUP
58
59