]> Dogcows Code - chaz/tar/blob - tests/incr08.at
Update copyright years.
[chaz/tar] / tests / incr08.at
1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2 # Test suite for GNU tar.
3 # Copyright 2013-2014 Free Software Foundation, Inc.
4 #
5 # GNU tar is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # GNU tar is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 # Description: In tar 1.26 listed-incremental with -C and absolute path
19 # would malfunction under certain conditions due to buggy filename
20 # normalization.
21 #
22 # The value returned by normalize_filename() is used to populate the "caname"
23 # field in both the "directory" structure in incremen.c and the "name"
24 # structure in names.c, and in both cases that field is then used in the
25 # "hash" and "compare" functions for the related hash tables. Thus, the
26 # fact that the returned value doesn't reflect the operation of previous
27 # "-C" options means that it's possible for two different directories to
28 # be given the same "caname" value in the hashed structure and thus end up
29 # being confused with each other.
30 #
31 # The bug is triggered when dumping both relative paths after -C and
32 # absolute paths that match the process' current working directory.
33 #
34 # Reported by: Nathan Stratton Treadway <nathanst@ontko.com>
35 # References: <20130922192135.GJ32256@shire.ontko.com>,
36 # http://lists.gnu.org/archive/html/bug-tar/2013-09/msg00034.html
37
38 AT_SETUP([filename normalization])
39 AT_KEYWORDS([incremental create incr08])
40
41 AT_TAR_CHECK([
42 AT_SORT_PREREQ
43 mkdir tartest
44 cd tartest
45 mkdir foo
46 mkdir foo/subdir
47 mkdir foo/subdir/dir1
48 mkdir subdir
49 mkdir subdir/dir2
50 decho A
51 find .|sort
52
53 decho B
54 DIR=`pwd`
55 tar -cvf ../foo.tar --listed-incremental=../foo.snar -C foo . $DIR 2>../err |\
56 sed "s|$DIR|ABSPATH|"
57 sed "s|$DIR|ABSPATH|" ../err >&2
58 ],
59 [0],
60 [A
61 .
62 ./foo
63 ./foo/subdir
64 ./foo/subdir/dir1
65 ./subdir
66 ./subdir/dir2
67 B
68 ./
69 ./subdir/
70 ./subdir/dir1/
71 ABSPATH/
72 ABSPATH/subdir/
73 ABSPATH/subdir/dir2/
74 ],
75 [A
76 B
77 tar: .: Directory is new
78 tar: ./subdir: Directory is new
79 tar: ./subdir/dir1: Directory is new
80 tar: ABSPATH: Directory is new
81 tar: ABSPATH/subdir: Directory is new
82 tar: ABSPATH/subdir/dir2: Directory is new
83 tar: Removing leading `/' from member names
84 ],[],[],[gnu])
85
86 AT_CLEANUP
This page took 0.032144 seconds and 4 git commands to generate.