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

Cygwin, better handle read-only FS #504

Merged
merged 1 commit into from
Apr 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 8 additions & 0 deletions encfs/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,14 @@ void *encfs_init(fuse_conn_info *conn) {
// set fuse connection options
conn->async_read = 1u;

#ifdef __CYGWIN__
// WinFsp needs this to partially handle read-only FS
// See https://github.com/billziss-gh/winfsp/issues/157 for details
if (ctx->opts->readOnly) {
conn->want |= (conn->capable & FSP_FUSE_CAP_READ_ONLY);
}
#endif

// if an idle timeout is specified, then setup a thread to monitor the
// filesystem.
if (ctx->args->idleTimeout > 0) {
Expand Down
2 changes: 1 addition & 1 deletion integration/normal.t.pl
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ sub links
{
my $hardlinkTests = shift;

my $contents = "hello world\n";
my $contents = "hello world";
ok( open(OUT, "> $crypt/data"), "create file for link test" );
print OUT $contents;
close OUT;
Expand Down
2 changes: 1 addition & 1 deletion integration/reverse.t.pl
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ sub symlink_test
{
my $target = shift;
ok(symlink($target, "$plain/symlink"), "Symlink create, $plain/symlink -> $target");
ok(my $dec = readlink("$decrypted/symlink"), "Symlink read, $decrypted/symlink");
ok(my $dec = readlink("$decrypted/symlink"), "Symlink read, $decrypted/symlink -> $target");
$dec.="";
ok($dec eq $target, "Symlink compare, '$target' != '$dec'");
my $return_code = ($have_xattr) ? system(@binattr, "$decrypted/symlink") : 0;
Expand Down