summaryrefslogtreecommitdiff
path: root/tests/cli/cli_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cli/cli_test.go')
-rw-r--r--tests/cli/cli_test.go41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/cli/cli_test.go b/tests/cli/cli_test.go
index 3e1bf42..232c8cc 100644
--- a/tests/cli/cli_test.go
+++ b/tests/cli/cli_test.go
@@ -8,6 +8,7 @@ import (
"os"
"os/exec"
"strconv"
+ "strings"
"syscall"
"testing"
"time"
@@ -644,3 +645,43 @@ func TestSymlinkedCipherdir(t *testing.T) {
t.Errorf("wrong Readdirnames result: %v", names)
}
}
+
+func TestBypass(t *testing.T) {
+ dir := test_helpers.InitFS(t)
+ mnt := dir + ".mnt"
+
+ test_helpers.MountOrFatal(t, dir, mnt, "-badname=*", "-extpass=echo test")
+ defer test_helpers.UnmountPanic(mnt)
+
+ file := mnt + "/file"
+ err := ioutil.WriteFile(file, []byte("somecontent"), 0600)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ invalid_file_name := "invalid_file"
+ invalid_file := dir + "/" + invalid_file_name
+ err = ioutil.WriteFile(invalid_file, []byte("somecontent"), 0600)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ f, err := os.Open(mnt)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer f.Close()
+
+ names, err := f.Readdirnames(0)
+ found := false
+ for _, name := range names {
+ if strings.Contains(name, invalid_file_name) {
+ found = true
+ break
+ }
+ }
+
+ if !found {
+ t.Errorf("did not find invalid name %s in %v", invalid_file_name, names)
+ }
+}