From 21904cd5f03f853ea6ceccbb414a5070c1f96324 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sat, 10 Dec 2016 12:49:43 +0100 Subject: [PATCH] ctlsock: exit if socket cannot be created --- mount.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mount.go b/mount.go index 29d34b8..b9bdc40 100644 --- a/mount.go +++ b/mount.go @@ -178,7 +178,13 @@ func initFuseFrontend(key []byte, args *argContainer, confFile *configfile.ConfF ctlSockBackend = fs } if args.ctlsock != "" { - ctlsock.CreateAndServe(args.ctlsock, ctlSockBackend) + err := ctlsock.CreateAndServe(args.ctlsock, ctlSockBackend) + if err != nil { + // TODO if the socket cannot be created, we should exit BEFORE + // asking the user for the password + tlog.Fatal.Printf("ctlsock: %v", err) + os.Exit(ErrExitMount) + } } pathFsOpts := &pathfs.PathNodeFsOptions{ClientInodes: true} pathFs := pathfs.NewPathNodeFs(finalFs, pathFsOpts)