aboutsummaryrefslogtreecommitdiff
path: root/mount.go
diff options
context:
space:
mode:
Diffstat (limited to 'mount.go')
-rw-r--r--mount.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/mount.go b/mount.go
index 489ae31..fd6c313 100644
--- a/mount.go
+++ b/mount.go
@@ -109,6 +109,12 @@ func doMount(args *argContainer) {
defer wipeKeys()
// Initialize go-fuse FUSE server
srv := initGoFuse(fs, args)
+ // Start serving the control socket only now. fusefrontend's
+ // EncryptPath/DecryptPath use the root inode, which go-fuse initializes
+ // in initGoFuse. Requests that arrived earlier wait in the listen backlog.
+ if args._ctlsockFd != nil {
+ go ctlsocksrv.Serve(args._ctlsockFd, fs.(ctlsocksrv.Interface))
+ }
if x, ok := fs.(AfterUnmounter); ok {
defer x.AfterUnmount()
}
@@ -351,11 +357,6 @@ func initFuseFrontend(args *argContainer) (rootNode fs.InodeEmbedder, wipeKeys f
} else {
rootNode = fusefrontend.NewRootNode(frontendArgs, cEnc, nameTransform)
}
- // We have opened the socket early so that we cannot fail here after
- // asking the user for the password
- if args._ctlsockFd != nil {
- go ctlsocksrv.Serve(args._ctlsockFd, rootNode.(ctlsocksrv.Interface))
- }
return rootNode, func() { cCore.Wipe() }
}