Closed mattmart3 closed 1 month ago
Thanks Matteo for your detailed bug report.
I confirm that hard links are not properly handled by fuse-archive
.
The proposed pull request #11 does not solve the issue, at least not just by itself. I tried it. When I apply it, I get two files, but the second one is empty:
$ ls -lh mnt
total 0
-r--r--r-- 1 fdegros primarygroup 35 Aug 4 10:33 file1
-r--r--r-- 1 fdegros primarygroup 0 Aug 4 10:33 file2
In order to fully handle hard links, fuse-archive
would require further modifications.
Hard links produce an error and are not mounted. The issue is likely related to how libarchive handles hard links.
How to reproduce:
$ ln file1 file2
$ stat file1 file2 File: file1 Size: 35 Blocks: 8 IO Block: 4096 regular file Device: 254,0 Inode: 794969 Links: 2 Access: (0644/-rw-r--r--) Uid: ( 1000/ eugene) Gid: ( 1000/ eugene) Access: 2023-07-31 16:12:00.330384852 +0200 Modify: 2023-07-31 16:12:00.330384852 +0200 Change: 2023-07-31 16:12:07.123700568 +0200 Birth: 2023-07-31 16:12:00.330384852 +0200 File: file2 Size: 35 Blocks: 8 IO Block: 4096 regular file Device: 254,0 Inode: 794969 Links: 2 Access: (0644/-rw-r--r--) Uid: ( 1000/ eugene) Gid: ( 1000/ eugene) Access: 2023-07-31 16:12:00.330384852 +0200 Modify: 2023-07-31 16:12:00.330384852 +0200 Change: 2023-07-31 16:12:07.123700568 +0200 Birth: 2023-07-31 16:12:00.330384852 +0200
$ tar cvaf test_fuse_archive_hard_links.tar.gz file1 file2 file1 file2
$ git clone https://github.com/google/fuse-archive.git -b v0.1.14 $ cd fuse-archive $ make all $ ./out/fuse-archive ~/test_fuse_archive_hard_links.tar.gz /mnt/tmp fuse-archive: irregular non-link file in /home/eugene/test_fuse_archive_hard_links.tar.gz: /file2 $ ls /mnt/tmp file1
$ mkdir ~/out && tar xvaf ~/test_fuse_archive_hard_links.tar.gz -C ~/out $ stat ~/out/file1 ~/out/file2 File: /home/eugene/out/file1 Size: 35 Blocks: 8 IO Block: 4096 regular file Device: 254,0 Inode: 15874535 Links: 2 Access: (0644/-rw-r--r--) Uid: ( 1000/ eugene) Gid: ( 1000/ eugene) Access: 2023-07-31 16:49:52.049826264 +0200 Modify: 2023-07-31 16:12:00.000000000 +0200 Change: 2023-07-31 16:49:52.049826264 +0200 Birth: 2023-07-31 16:49:52.049826264 +0200 File: /home/eugene/out/file2 Size: 35 Blocks: 8 IO Block: 4096 regular file Device: 254,0 Inode: 15874535 Links: 2 Access: (0644/-rw-r--r--) Uid: ( 1000/ eugene) Gid: ( 1000/ eugene) Access: 2023-07-31 16:49:52.049826264 +0200 Modify: 2023-07-31 16:12:00.000000000 +0200 Change: 2023-07-31 16:49:52.049826264 +0200 Birth: 2023-07-31 16:49:52.049826264 +0200
A possible solution has already been submitted in PR #11.