Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 2 options --noattrcache --nodatacache #500

Merged
merged 3 commits into from
Mar 27, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions encfs/encfs.pod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ B<encfs> [B<--version>] [B<-v>|B<--verbose>] [B<-c>|B<--config>] [B<-t>|B<--sysl
[B<--reverse>] [B<--reversewrite>] [B<--extpass=program>] [B<-S>|B<--stdinpass>]
[B<--anykey>] [B<--forcedecode>] [B<-require-macs>]
[B<-i MINUTES>|B<--idle=MINUTES>] [B<-m>|B<--ondemand>] [B<--delaymount>] [B<-u>|B<--unmount>]
[B<--public>] [B<--nocache>] [B<--no-default-flags>]
[B<--public>] [B<--nocache>] [B<--noattrcache>] [B<--nodatacache>] [B<--no-default-flags>]
[B<-o FUSE_OPTION>] [B<-d>|B<--fuse-debug>] [B<-H>|B<--fuse-help>]
I<rootdir> I<mountPoint>
[B<--> [I<Fuse Mount Options>]]
Expand Down Expand Up @@ -238,9 +238,17 @@ you want before considering the use of B<--public>.

Disable the kernel's cache of file attributes.
Setting this option makes EncFS pass "attr_timeout=0" and "entry_timeout=0" to
FUSE. This makes sure that modifications to the backing files that occour
outside EncFS show up immediately in the EncFS mount. The main use case
for "--nocache" is reverse mode.
FUSE. This makes sure that modifications to the backing file attributes that
occour outside EncFS show up immediately in the EncFS mount. The internal EncFS
data cache is also disabled. The main use case for B<--nocache> is reverse mode.

=item B<--noattrcache>

Same as B<--nocache> but for attributes only.

=item B<--nodatacache>

Same as B<--nocache> but for data only.

=item B<--no-default-flags>

Expand Down
20 changes: 17 additions & 3 deletions encfs/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@
* not have a short version */
#define LONG_OPT_ANNOTATE 513
#define LONG_OPT_NOCACHE 514
#define LONG_OPT_REQUIRE_MAC 515
#define LONG_OPT_INSECURE 516
#define LONG_OPT_NODATACACHE 515
#define LONG_OPT_NOATTRCACHE 516
#define LONG_OPT_REQUIRE_MAC 517
#define LONG_OPT_INSECURE 518

using namespace std;
using namespace encfs;
Expand Down Expand Up @@ -254,7 +256,9 @@ static bool processArgs(int argc, char *argv[],
{"syslogtag", 1, nullptr, 't'}, // syslog tag
{"annotate", 0, nullptr,
LONG_OPT_ANNOTATE}, // Print annotation lines to stderr
{"nocache", 0, nullptr, LONG_OPT_NOCACHE}, // disable caching
{"nocache", 0, nullptr, LONG_OPT_NOCACHE}, // disable all caching
{"nodatacache", 0, nullptr, LONG_OPT_NODATACACHE}, // disable data caching
{"noattrcache", 0, nullptr, LONG_OPT_NOATTRCACHE}, // disable attr caching
{"verbose", 0, nullptr, 'v'}, // verbose mode
{"version", 0, nullptr, 'V'}, // version
{"reverse", 0, nullptr, 'r'}, // reverse encryption
Expand Down Expand Up @@ -381,6 +385,16 @@ static bool processArgs(int argc, char *argv[],
* Fallout unknown, disabling for safety */
PUSHARG("-oentry_timeout=0");
break;
case LONG_OPT_NODATACACHE:
out->opts->noCache = true;
break;
case LONG_OPT_NOATTRCACHE:
PUSHARG("-oattr_timeout=0");
PUSHARG("-oentry_timeout=0");
#ifdef __CYGWIN__
PUSHARG("-oFileInfoTimeout=0");
#endif
break;
case 'm':
out->opts->mountOnDemand = true;
break;
Expand Down
2 changes: 1 addition & 1 deletion integration/reverse.t.pl
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ sub mount
ok(waitForFile("$plain/.encfs6.xml"), "plain .encfs6.xml exists") or BAIL_OUT("'$plain/.encfs6.xml'");
my $e = encName(".encfs6.xml");
ok(waitForFile("$ciphertext/$e"), "encrypted .encfs6.xml exists") or BAIL_OUT("'$ciphertext/$e'");
system("ENCFS6_CONFIG=$plain/.encfs6.xml ./build/encfs --nocache --extpass=\"echo test\" $ciphertext $decrypted");
system("ENCFS6_CONFIG=$plain/.encfs6.xml ./build/encfs --noattrcache --nodatacache --extpass=\"echo test\" $ciphertext $decrypted");
ok(waitForFile("$decrypted/.encfs6.xml"), "decrypted .encfs6.xml exists") or BAIL_OUT("'$decrypted/.encfs6.xml'");
}

Expand Down