From 53d6a9999dd0e4c31636d16179f284fff35a35d9 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Thu, 7 Jun 2018 22:50:30 +0200 Subject: main: accept -dev, -nodev, -suid, -nosuid, -exec, -noexec When mounted via /etc/fstab like this, /a /b fuse.gocryptfs default 0 0 we always get extra options passed. As reported by @mahkoh at https://github.com/rfjakob/gocryptfs/pull/233 : mount passes `-o noexec` if `-o user` is set and `-o exec` is not set. If both `-o user` and `-o exec` are set, it passes `-o exec`. Make these options work, and in addtion, also make -suid and -rw work the same way. Reported-by: @mahkoh --- tests/test_helpers/helpers.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tests/test_helpers/helpers.go') diff --git a/tests/test_helpers/helpers.go b/tests/test_helpers/helpers.go index e7fcf4b..ef748e2 100644 --- a/tests/test_helpers/helpers.go +++ b/tests/test_helpers/helpers.go @@ -433,9 +433,14 @@ func ExtractCmdExitCode(err error) int { return 0 } // OMG this is convoluted - err2 := err.(*exec.ExitError) - code := err2.Sys().(syscall.WaitStatus).ExitStatus() - return code + if err2, ok := err.(*exec.ExitError); ok { + return err2.Sys().(syscall.WaitStatus).ExitStatus() + } + if err2, ok := err.(*os.PathError); ok { + return int(err2.Err.(syscall.Errno)) + } + log.Panicf("could not decode error %#v", err) + return 0 } // ListFds lists our open file descriptors. -- cgit v1.2.3