1 # Process this file with autom4te to create testsuite. -*- Autotest -*-
2 # Test suite for GNU tar.
3 # Copyright 2013 Free Software Foundation, Inc.
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.
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.
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/>.
18 # Description: In tar 1.26 listed-incremental with -C and absolute path
19 # would malfunction under certain conditions due to buggy filename
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.
31 # The bug is triggered when dumping both relative paths after -C and
32 # absolute paths that match the process' current working directory.
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
38 AT_SETUP([filename normalization])
39 AT_KEYWORDS([incremental create incr08])
55 tar -cvf ../foo.tar --listed-incremental=../foo.snar -C foo . $DIR 2>../err |\
57 sed "s|$DIR|ABSPATH|" ../err >&2
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