Debian Codegraph @

tests/delete06.at

raw ◀ ▶
1 Debian patch touch this file
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2
3 # Test suite for GNU tar.
4 # Copyright 2023 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 # When deleting last partially written member from a truncated archive
22 # tar 1.34 would miss EOF and spin in a dead loop in delete.c:flush_file.
23 # References: https://savannah.gnu.org/bugs/?63823
24
25 AT_SETUP([EOF detection])
26 AT_KEYWORDS([delete delete06])
27
28 AT_TAR_CHECK([
29 mkdir b
30 touch a b/1 c
31 tar -cf archive.tar a b/1 c
32 case $TEST_TAR_FORMAT in
33 gnu) size=1500;;
34 pax) size=3072;;
35 esac
36 dd if=archive.tar of=trunc.tar bs=$size count=1 2>/dev/null
37 tar --delete 'b/' -f trunc.tar
38 ],
•39 [2],
40 [],
41 [tar: lseek: trunc.tar: Value too large for defined data type
42 tar: Exiting with failure status due to previous errors
43 ],[],[],[gnu, pax])
44
45 AT_CLEANUP