aboutsummaryrefslogtreecommitdiff
path: root/internal/configfile/config_file.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-01-26 21:32:08 +0100
committerJakob Unterwurzacher2017-01-26 21:32:08 +0100
commit39eca53677abd0c397a884dd29ebc98ddfcbb270 (patch)
tree2127fecd309ada0ad3ac18ddd30584fa6c705b74 /internal/configfile/config_file.go
parenta7c7588deb2f256775667c986e1d85965dc2c3e6 (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 'internal/configfile/config_file.go')
-rw-r--r--internal/configfile/config_file.go6
1 files changed, 4 insertions, 2 deletions
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