|
From: | Kirill Pushkaryov |
Subject: | [Bug-tar] The --exclude-ignore option acts recursively, while it shouldn't |
Date: | Sun, 30 Oct 2016 11:21:27 +0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
Hello! I've found that patterns from a file specified via the
--exclude-ignore option are excluded from subdirectories too,
which contradicts the manual. The problem was encountered in tar
1.28 and confirmed in the latest tar from the
git.savannah.gnu.org/tar.git. The manual says (6.4): "`--exclude-ignore=file'
How to reproduce:
Current result:
Expected result: test/a/b must not be excluded. I'm not familiar with the source code, but after quick debugging I suspect a bug in info_attach_exclist() (exclist.c:117 from the git HEAD (1d2674b)): ent = xmalloc (sizeof (*ent)); It looks like file->flags are propagated to ent->flags only when they're equal to EXCL_DEFAULT (0x00), so EXCL_NON_RECURSIVE (0x02) pertaining to --exclude-ignore is dropped, which prevents the condition in excluded_name() (exclist.c:172) from skipping non-recursive entries from distant ancestors. -- WBR, Kirill Pushkaryov. |
[Prev in Thread] | Current Thread | [Next in Thread] |