summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorJacob Helwig <jacob@puppetlabs.com>2011-07-21 16:27:28 -0700
committerJacob Helwig <jacob@puppetlabs.com>2011-07-21 16:27:28 -0700
commita87ef54385cbf325d6b085200606562b0d4d7876 (patch)
tree9f6bc485d5d873df5c05de51e72e6a4d3f35ee0c /spec
parent790e947e5581fc51e7002c81c3848fb7048bb6ac (diff)
parent111a4b546dd1bcaab182d5c8ad694404c2c2f91c (diff)
downloadpuppet-a87ef54385cbf325d6b085200606562b0d4d7876.tar.gz
puppet-a87ef54385cbf325d6b085200606562b0d4d7876.tar.xz
puppet-a87ef54385cbf325d6b085200606562b0d4d7876.zip
Merge remote-tracking branch 'barn/tickets/2.6.x/6857-password-disclosure-when-changing-a-users-password' into 2.6.x
* barn/tickets/2.6.x/6857-password-disclosure-when-changing-a-users-password: (#6857) Password disclosure when changing a user's password
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/type/user_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/unit/type/user_spec.rb b/spec/unit/type/user_spec.rb
index 5a84af443..594802c6e 100755
--- a/spec/unit/type/user_spec.rb
+++ b/spec/unit/type/user_spec.rb
@@ -290,6 +290,14 @@ describe user do
@password.change_to_s("other", "mypass").should_not be_include("mypass")
end
+ it "should redact the password when displaying the old value" do
+ @password.is_to_s("currentpassword").should =~ /^\[old password hash redacted\]$/
+ end
+
+ it "should redact the password when displaying the new value" do
+ @password.should_to_s("newpassword").should =~ /^\[new password hash redacted\]$/
+ end
+
it "should fail if a ':' is included in the password" do
lambda { @password.should = "some:thing" }.should raise_error(Puppet::Error)
end