aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/exitcodes/exitcodes.go5
-rw-r--r--internal/readpassword/read.go2
2 files changed, 5 insertions, 2 deletions
diff --git a/internal/exitcodes/exitcodes.go b/internal/exitcodes/exitcodes.go
index cba74b6..3e78b64 100644
--- a/internal/exitcodes/exitcodes.go
+++ b/internal/exitcodes/exitcodes.go
@@ -14,7 +14,8 @@ const (
// 3 is reserved because it was used by earlier gocryptfs version as a generic
// "mount" error.
- // CipherDir means that the CIPHERDIR does not exist
+ // CipherDir means that the CIPHERDIR does not exist, is not empty, or is not
+ // a directory.
CipherDir = 6
// Init is an error on filesystem init
Init = 7
@@ -50,6 +51,8 @@ const (
CtlSock = 20
// PanicLogCreate - there was a problem creating the /tmp/gocryptfs_paniclog.XYZ file.
PanicLogCreate = 21
+ // PasswordEmpty - we received an empty password
+ PasswordEmpty = 22
)
// Err wraps an error with an associated numeric exit code
diff --git a/internal/readpassword/read.go b/internal/readpassword/read.go
index 058735d..481911b 100644
--- a/internal/readpassword/read.go
+++ b/internal/readpassword/read.go
@@ -65,7 +65,7 @@ func readPasswordTerminal(prompt string) string {
fmt.Fprintf(os.Stderr, "\n")
if len(p) == 0 {
tlog.Fatal.Println("Password is empty")
- os.Exit(exitcodes.ReadPassword)
+ os.Exit(exitcodes.PasswordEmpty)
}
return string(p)
}