mirror of
https://github.com/vgough/encfs.git
synced 2024-11-22 16:03:34 +01:00
reverse: re-enable kernel cache
Disabling the kernel cache make sure the encrypted view is always up-to-date, however, it causes a factor 3 slowdown. Please use --nocache manually if you want to disable caching. Closes #60. Also replaces the magic identifiers 513 and 514 by proper defines.
This commit is contained in:
parent
b2f50bab1e
commit
5ef4ab0a41
@ -57,6 +57,11 @@
|
|||||||
extern "C" void fuse_unmount_compat22(const char *mountpoint);
|
extern "C" void fuse_unmount_compat22(const char *mountpoint);
|
||||||
#define fuse_unmount fuse_unmount_compat22
|
#define fuse_unmount fuse_unmount_compat22
|
||||||
|
|
||||||
|
/* Arbitrary identifiers for long options that do
|
||||||
|
* not have a short version */
|
||||||
|
#define LONG_OPT_ANNOTATE 513
|
||||||
|
#define LONG_OPT_NOCACHE 514
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace rlog;
|
using namespace rlog;
|
||||||
using namespace rel;
|
using namespace rel;
|
||||||
@ -215,10 +220,10 @@ static bool processArgs(int argc, char *argv[],
|
|||||||
{"delaymount", 0, 0, 'M'}, // delay initial mount until use
|
{"delaymount", 0, 0, 'M'}, // delay initial mount until use
|
||||||
{"public", 0, 0, 'P'}, // public mode
|
{"public", 0, 0, 'P'}, // public mode
|
||||||
{"extpass", 1, 0, 'p'}, // external password program
|
{"extpass", 1, 0, 'p'}, // external password program
|
||||||
// {"single-thread", 0, 0, 's'}, // single-threaded mode
|
// {"single-thread", 0, 0, 's'}, // single-threaded mode
|
||||||
{"stdinpass", 0, 0, 'S'}, // read password from stdin
|
{"stdinpass", 0, 0, 'S'}, // read password from stdin
|
||||||
{"annotate", 0, 0, 513}, // Print annotation lines to stderr
|
{"annotate", 0, 0, LONG_OPT_ANNOTATE}, // Print annotation lines to stderr
|
||||||
{"nocache", 0, 0, 514}, // disable caching
|
{"nocache", 0, 0, LONG_OPT_NOCACHE}, // disable caching
|
||||||
{"verbose", 0, 0, 'v'}, // verbose mode
|
{"verbose", 0, 0, 'v'}, // verbose mode
|
||||||
{"version", 0, 0, 'V'}, // version
|
{"version", 0, 0, 'V'}, // version
|
||||||
{"reverse", 0, 0, 'r'}, // reverse encryption
|
{"reverse", 0, 0, 'r'}, // reverse encryption
|
||||||
@ -255,7 +260,7 @@ static bool processArgs(int argc, char *argv[],
|
|||||||
case 'S':
|
case 'S':
|
||||||
out->opts->useStdin = true;
|
out->opts->useStdin = true;
|
||||||
break;
|
break;
|
||||||
case 513:
|
case LONG_OPT_ANNOTATE:
|
||||||
out->opts->annotate = true;
|
out->opts->annotate = true;
|
||||||
break;
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
@ -295,8 +300,11 @@ static bool processArgs(int argc, char *argv[],
|
|||||||
* filesystem where something can change the underlying
|
* filesystem where something can change the underlying
|
||||||
* filesystem without going through fuse can run into
|
* filesystem without going through fuse can run into
|
||||||
* inconsistencies."
|
* inconsistencies."
|
||||||
* Enabling reverse automatically enables noCache */
|
* However, disabling the caches causes a factor 3
|
||||||
case 514:
|
* slowdown. If you are concerned about inconsistencies,
|
||||||
|
* please use --nocache. */
|
||||||
|
break;
|
||||||
|
case LONG_OPT_NOCACHE:
|
||||||
/* Disable EncFS block cache
|
/* Disable EncFS block cache
|
||||||
* Causes reverse grow tests to fail because short reads
|
* Causes reverse grow tests to fail because short reads
|
||||||
* are returned */
|
* are returned */
|
||||||
|
@ -46,7 +46,7 @@ sub cleanup
|
|||||||
sub mount
|
sub mount
|
||||||
{
|
{
|
||||||
delete $ENV{"ENCFS6_CONFIG"};
|
delete $ENV{"ENCFS6_CONFIG"};
|
||||||
system("./encfs/encfs --extpass=\"echo test\" --standard $plain $ciphertext --reverse");
|
system("./encfs/encfs --extpass=\"echo test\" --standard $plain $ciphertext --reverse --nocache");
|
||||||
ok(waitForFile("$plain/.encfs6.xml"), "plain .encfs6.xml exists") or BAIL_OUT("'$plain/.encfs6.xml'");
|
ok(waitForFile("$plain/.encfs6.xml"), "plain .encfs6.xml exists") or BAIL_OUT("'$plain/.encfs6.xml'");
|
||||||
my $e = encName(".encfs6.xml");
|
my $e = encName(".encfs6.xml");
|
||||||
ok(waitForFile("$ciphertext/$e"), "encrypted .encfs6.xml exists") or BAIL_OUT("'$ciphertext/$e'");
|
ok(waitForFile("$ciphertext/$e"), "encrypted .encfs6.xml exists") or BAIL_OUT("'$ciphertext/$e'");
|
||||||
|
Loading…
Reference in New Issue
Block a user