summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Schmidt <yath@yath.de>2013-06-27 17:58:54 +0200
committerSebastian Schmidt <yath@yath.de>2013-06-27 17:58:54 +0200
commit45ab02b8e3b03c9f2da704786190b420ef726cec (patch)
tree0178fc4568de1a1fe87ad04bb73ef3b60d63af26
parent1a2f8aed3f55a63ff143302a3a42ca7997e51db0 (diff)
Save passwords set via 'set' as hash, if asked to.
Trocla doesn't save the hashed password in the data file, even if the format passed to 'set' is not 'plain': $ echo foobar | trocla set testuser sha512crypt -p $ grep -A1 testuser trocla_data.yaml testuser: sha512crypt: foobar
-rwxr-xr-xbin/trocla5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/trocla b/bin/trocla
index 39b9e76..a4f51cc 100755
--- a/bin/trocla
+++ b/bin/trocla
@@ -64,10 +64,11 @@ def set(options)
else
password = options.delete(:password) || STDIN.read.chomp
end
+ format = options.delete(:trocla_format)
Trocla.new(options.delete(:config_file)).set_password(
options.delete(:trocla_key),
- options.delete(:trocla_format),
- password
+ format,
+ Trocla::Formats[format].format(password, options.delete(:other_options).shift.to_s)
)
""
end