Ticket #2297: show empty directories in incremental tar archives.
commit49898835fde9dc8ceb25f21cda6fb9541961c05f
authorWitold Filipczyk <witold.filipczyk@cba.pl>
Tue, 25 Apr 2017 10:20:07 +0000 (25 13:20 +0300)
committerAndrew Borodin <aborodin@vmail.ru>
Thu, 4 May 2017 06:48:22 +0000 (4 09:48 +0300)
tree17e1cbf376918387ef9e4e3124c942a4ae7d6049
parent59b12cf2cbd402ac182a10c36e5fcb7e5f8f6358
Ticket #2297:  show empty directories in incremental tar archives.

How to reproduce:
1. Create two tar files with empty dir:
$ mkdir -p dir/dir1; mkdir dir/dir2; touch dir/dir1/file
$ tar cf normal.tar dir/
$ tar cf incremental.tar -g incremental.snap dir/
2. Press Enter to enter to normal.tar.
Result: normal.tar contains dir/dir2, incremental.tar doesn't.
Expected result: incremental.tar contains dir/dir2.

This patch also fixes Ticket #3709: Wrong directories owner for tar
--numeric-owner -g.

How to reproduce:
As root:
 # mkdir -p TEST/TEST2
 # echo aaa > TEST/TEST2/aaa.txt
 # chown 10000:10000 TEST
 # chown 10001:10001 TEST/TEST2
 # chown 10002:10002 TEST/TEST2/aaa.txt

 # tar --numeric-owner -zcf test1.tar.gz TEST
 # tar --numeric-owner -g test.inc -zcf test2.tar.gz TEST

and now view these tarballs with long view. Directories of test2.tar.gz
have owner root instead of 10000 or 10001, but if you untar them using
tar -xvf directories owners are correct

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
src/vfs/tar/tar.c