jetwhiz / encfs4win

Windows port of EncFS
https://encfs.win
Other
402 stars 41 forks source link

Windows reporting horribly incorrect file information for new files created on EncFS virtual drive #33

Closed gh223682 closed 8 years ago

gh223682 commented 8 years ago

In trying to troubleshoot some other issues with EncFS4Win pre-1.10.1-RC5 on Windows 10, I discovered some other weird behavior where files created on the EncFS virtual drive

are reported to have HUGE 200 petabyte file sizes.

To reproduce, simply create an empty file either through explorer with:

New Item-->Text Document

or from the command-line with the simple command:

% echo > test.txt

Explorer reports that this file has the size 189,658,273,153,025 KB and the epoch as the file creation time.

Furthermore, explorer reports different file sizes depending on whether or not encfs.exe is running in single-threaded or multi-threaded mode.

Without the "-s" option, the file size is reported as:

189,658,273,153,025 KB

With the "-s" option, the file size is reported as:

201,201,266,196,481 KB

Last, encfs.exe seems to crash sometimes when I try to do stuff with this file.

If these problems are caused by Dokany 1.0, perhaps legacy support/builds would be helpful. See Issue #29.

jetwhiz commented 8 years ago

Hi @gh223682,

This is a known issue with Dokany 1.0 (https://github.com/dokan-dev/dokany/issues/234), but will be easy for them to fix and should be working in their next release candidate.

We can temporarily fix this on our end with the following patch to encfs/encfs.cpp:

@@ -227,7 +227,7 @@
 #if defined(fuse_fill_dir_flags)
         if (filler(buf, name.c_str(), &st, 0, 0)) break;
 #else
-        if (filler(buf, name.c_str(), &st, 0)) break;
+        if (filler(buf, name.c_str(), NULL, 0)) break;
 #endif

         name = dt.nextPlaintextName(&fileType, &inode);

I am hoping to release a legacy installer in addition to the normal installer (with Dokany 1.0) starting with 1.10.1-RC5, though (as per issue #29).

jetwhiz commented 8 years ago

I have wrapped this patch up in 1.10.1-RC5, since passing a struct stat is not necessary with Dokany