[Toybox] [PATCH 1/2] tar: don't recurse into excluded directories

Rob Landley rob at landley.net
Tue Jun 23 14:02:55 PDT 2020


On 6/21/20 2:24 PM, William Djupström wrote:
> ping?

Sorry, thread got long and twisty. Ok, test case:

> host tar requires --exclude-from to be placed before the input files
> 
>     $ mkdir -p folder/skip/oof
>     $ chmod 000 folder/skip/oof
>     $ ./toybox tar -X <(echo skip) -cvf test.tar folder
>     folder/
>     tar: folder/skip/oof: Permission denied
> 
>     $ tar -X <(echo skip) -cvf test.tar folder
>     folder/
> 
>     $ tar -cvf test.tar folder -X <(echo skip)
>     folder/
>     folder/skip/
>     tar: folder/skip/oof: Cannot open: Permission denied

Ok, added a test case, and fixed a second issue the test case showed (-v output
going to stderr instead of stdout when there's a -f).

I fixed it a slightly different way to avoid adding a second goto label. Does
this fix your use case?

Thanks,

Rob


More information about the Toybox mailing list