diff options
author | Guillem Jover <guillem@debian.org> | 2012-09-23 08:53:02 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2012-10-05 00:59:18 +0200 |
commit | e9ea356ab8ab442420cea887d4734b0b8022ea12 (patch) | |
tree | 74143ef47833520703944e7266dbe814bdca1cc0 /src/filters.c | |
parent | caac19a3df7686db5907db3d8d6472855536442b (diff) | |
download | dpkg-e9ea356ab8ab442420cea887d4734b0b8022ea12.tar.gz |
dpkg: Ignore trailing filter subpattern slashes on reinclusion comparison
The code was not matching directories on subpatterns due to trailing
slashes, which was causing unpack failures as the containing
subdirectories were not being unpacked and as such, they were
subsequently missing from the file system.
While unpacking a «/usr/share/locale/de/LC_MESSAGES/foo.mo» file,
for example, something like the following options would trigger
this problem:
--path-exclude=/usr/share/locale/*
--path-include=/usr/share/locale/de/*
Closes: #688416
Diffstat (limited to 'src/filters.c')
-rw-r--r-- | src/filters.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/filters.c b/src/filters.c index 526673dad..1bde97cf3 100644 --- a/src/filters.c +++ b/src/filters.c @@ -114,6 +114,10 @@ filter_should_skip(struct tar_entry *ti) else path_len = strlen(f->pattern); + /* Ignore any trailing slash for the comparison. */ + while (path_len && f->pattern[path_len - 1] == '/') + path_len--; + debug(dbg_eachfiledetail, "filter subpattern '%.*s'", path_len, f->pattern); |