summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-02-10 14:25:22 -0600
committerJames Turnbull <james@lovedthanlost.net>2009-02-11 08:35:11 +1100
commitdb05c00af042cce1f09640071706efbc82742a01 (patch)
tree06f517aa5348537c368ebb770a5c45801167292b /lib
parentaa219e76b15a543c0091b83efbb13a711d657287 (diff)
downloadpuppet-db05c00af042cce1f09640071706efbc82742a01.tar.gz
puppet-db05c00af042cce1f09640071706efbc82742a01.tar.xz
puppet-db05c00af042cce1f09640071706efbc82742a01.zip
Fixing #1920 - user passwords no longer allow ':'
I wanted to include a snide remark in the error, but... Now you just get an exception when creating the user if the password includes this character. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib')
-rwxr-xr-xlib/puppet/type/user.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/puppet/type/user.rb b/lib/puppet/type/user.rb
index 9e32c89ae..e6b16a9ac 100755
--- a/lib/puppet/type/user.rb
+++ b/lib/puppet/type/user.rb
@@ -142,6 +142,10 @@ module Puppet
newproperty(:password, :required_features => :manages_passwords) do
desc "The user's password, in whatever encrypted format the local machine requires. Be sure to enclose any value that includes a dollar sign ($) in single quotes (\')."
+ validate do |value|
+ raise ArgumentError, "Passwords cannot include ':'" if value.include?(":")
+ end
+
def change_to_s(currentvalue, newvalue)
if currentvalue == :absent
return "created password"