diff options
author | Sebastian Schmidt <yath@yath.de> | 2013-06-27 17:58:54 +0200 |
---|---|---|
committer | Sebastian Schmidt <yath@yath.de> | 2013-06-27 17:58:54 +0200 |
commit | 45ab02b8e3b03c9f2da704786190b420ef726cec (patch) | |
tree | 0178fc4568de1a1fe87ad04bb73ef3b60d63af26 | |
parent | 1a2f8aed3f55a63ff143302a3a42ca7997e51db0 (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-x | bin/trocla | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 |