From 39eca53677abd0c397a884dd29ebc98ddfcbb270 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Thu, 26 Jan 2017 21:32:08 +0100 Subject: 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" --- internal/configfile/config_file.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'internal') diff --git a/internal/configfile/config_file.go b/internal/configfile/config_file.go index 0bee16f..c4865d7 100644 --- a/internal/configfile/config_file.go +++ b/internal/configfile/config_file.go @@ -83,9 +83,11 @@ func CreateConfFile(filename string, password string, plaintextNames bool, logN } // LoadConfFile - read config file from disk and decrypt the -// contained key using password. -// +// contained key using "password". // Returns the decrypted key and the ConfFile object +// +// If "password" is empty, the config file is read +// but the key is not decrypted (returns nil in its place). func LoadConfFile(filename string, password string) ([]byte, *ConfFile, error) { var cf ConfFile cf.filename = filename -- cgit v1.2.3