diff options
author | Jakob Unterwurzacher | 2017-01-26 21:32:08 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2017-01-26 21:32:08 +0100 |
commit | 39eca53677abd0c397a884dd29ebc98ddfcbb270 (patch) | |
tree | 2127fecd309ada0ad3ac18ddd30584fa6c705b74 /mount.go | |
parent | a7c7588deb2f256775667c986e1d85965dc2c3e6 (diff) |
main: make sure the ctlsock file is deleted on incorrect password
Otherwise the next try to mount ends in
"ctlsock: listen unix ctl.sock: bind: address already in use"
Diffstat (limited to 'mount.go')
-rw-r--r-- | mount.go | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -88,7 +88,14 @@ func doMount(args *argContainer) int { } else { // Load master key from config file // Prompts the user for the password - masterkey, confFile = loadConfig(args) + masterkey, confFile, err = loadConfig(args) + if err != nil { + if args._ctlsockFd != nil { + // Close the socket file (which also deletes it) + args._ctlsockFd.Close() + } + os.Exit(ErrExitLoadConf) + } printMasterKey(masterkey) } // We cannot use JSON for pretty-printing as the fields are unexported |