fcorbelli / zpaqfranz

Deduplicating archiver with encryption and paranoid-level tests. Swiss army knife for the serious backup and disaster recovery manager. Ransomware neutralizer. Win/Linux/Unix
MIT License
259 stars 22 forks source link

Found Unix attributes on Windows => checking for collision #105

Closed Erol-2022 closed 3 months ago

Erol-2022 commented 3 months ago

Hello,

On Windows, Is it safe to extract zpaq archives created on Linux systems? Here is the report of my Windows Server :

Found Unix attributes on Windows => checking for collision
No case collision (extracting Unix filenames on Windows)

zpaq archives created on a Oracle Linux 8 system.

fcorbelli commented 3 months ago

Yes. I do daily restore from Unix machines on Windows

You can get in trouble with case collisions (and reserved filenames) For example, two file on Linux

PIPPO.txt and Pippo.txt can become hard to extract on Windows (due to filesystem case in-sensitiveness)

Or lpt1.txt, cannot be restored on Windows, because this filename is not allowed, at all

But, even in this case, with zpaqfranz... you can 😄

fcorbelli commented 3 months ago

In addition, it is highly suggested to do the recovery tests on different machines with different CPUs and different operating systems and different filesystems

If you have a level of paranoia equal to mine there is the hashdeep option

fcorbelli commented 3 months ago
root@rambo:/tmp/test# ls -l
total 1
-rw-r--r-- 1 root root 6 May 27 21:57 Pippo.txt
-rw-r--r-- 1 root root 6 May 27 21:57 PIPPO.txt
root@rambo:/tmp/test# zpaqfranz a wintest *
zpaqfranz v59.7j-JIT-L(2024-05-27)
Creating wintest.zpaq at offset 0 + 0
Add 2024-05-27 19:57:21         2                 12 (  12.00  B) 16T (0 dirs)
2 +added, 0 -removed.

0 + (12 -> 12 ->  1.214) = 1.214  @ 1.95 KB/s
0.006 seconds (00:00:00) (all OK)
root@rambo:/tmp/test#

On Windows you'll get

Z:\>zpaqfranz x wintest.zpaq
zpaqfranz v59.7k-JIT-GUI-L,HW BLAKE3,SHA1/2,SFX64 v55.1,(2024-05-27)
franz:-hw

wintest.zpaq:
1 versions, 2 files, 1.214 bytes (1.19 KB)
Found Unix attributes on Windows => checking for collision
No case collision (extracting Unix filenames on Windows)
Extract 12 bytes (12.00  B) in 2 files (0 folders) / 32 T

0.032 seconds (00:00:00) (all OK)

Z:\>dir
 Il volume nell'unità Z è RamDisk
 Numero di serie del volume: 64B1-6932

 Directory di Z:\

27/05/2024  21:57                 6 PIPPO.txt
27/05/2024  21:57                 6 Pippo_00000001.txt
(...)

As you can see the file-caseness collision is handled Of course you cannt get PIPPO.txt and Pippo.txt, but this is not my fault 😄

Erol-2022 commented 3 months ago

Hello Mr.Corbelli,

The original files were copied from a Windows system to a Linux server archiving the files with zpaqfanz so there will be no uppercase\lowercase collision. Thanks for your support.

fcorbelli commented 3 months ago

Reviewing the source, I realized that the message may be misleading in the sense that "sanitization" is implemented automatically (the last true)

        uint32_t fixati     =casekollision(dt,kollisioni,true);

Basically if there is a collision, it corrects (or rather tries to). Only if a collision is not "cured" then it is considered an error

Short version: there is full interoperability between Windows and *nix (apart from path length, cases and forbidden files)