From e99e8417137a713348d2797ba813bcefe0c3984d Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Fri, 11 Dec 2015 19:54:53 +0100 Subject: Rmdir: handle creating and removing unreadable directories This patch also splits off Mkdir and Rmdir into its own file. Fixes issue #8, thanks to @diseq for the bug report. --- main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'main.go') diff --git a/main.go b/main.go index 21d8ed6..49b13d1 100644 --- a/main.go +++ b/main.go @@ -159,7 +159,7 @@ func main() { "Setting this to a lower value speeds up mounting but makes the password susceptible to brute-force attacks") flagSet.Parse(os.Args[1:]) - // Fork a child into the background if "-f" is not set and we are mounting a filesystem + // Fork a child into the background if "-f" is not set AND we are mounting a filesystem if !args.foreground && flagSet.NArg() == 2 { forkChild() // does not return } @@ -339,6 +339,11 @@ func pathfsFrontend(key []byte, args argContainer, confFile *cryptfs.ConfFile) * } srv.SetDebug(args.fusedebug) + // All FUSE file and directory create calls carry explicit permission + // information. We need an unrestricted umask to create the files and + // directories with the requested permissions. + syscall.Umask(0000) + return srv } -- cgit v1.2.3