From 2b3e6031eb3f39286a81f2a318e1f9ffbc5d4e2f Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sat, 25 Jun 2016 14:47:16 +0200 Subject: [PATCH] tests: open file with umask 0777 Regression test for https://github.com/vgough/encfs/issues/181 (fails at the moment, fixed in the next commits) --- tests/normal.t.pl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/normal.t.pl b/tests/normal.t.pl index 99e18b7..841c60a 100755 --- a/tests/normal.t.pl +++ b/tests/normal.t.pl @@ -2,7 +2,7 @@ # Test EncFS normal and paranoid mode -use Test::More tests => 102; +use Test::More tests => 104; use File::Path; use File::Copy; use File::Temp; @@ -46,6 +46,7 @@ sub runTests &renames; &internalModification; &grow; + &umask0777; &cleanup; } @@ -324,3 +325,12 @@ sub cleanup ok( ! -d $workingDir, "working dir removed"); } +# Test that we can create and write to a a file even if umask is set to 0777 +# Regression test for bug https://github.com/vgough/encfs/issues/181 +sub umask0777 +{ + my $old = umask(0777); + ok(open(my $fh, "+>$crypt/umask0777"), "open with umask 0777"); + close($fh); + umask($old); +}