Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/puppet/parser/functions/pw_hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
password = args[0]
return nil if password.nil? or password.empty?

salt = "$#{hash_type}$#{args[2]}"

# handle weak implementations of String#crypt
if 'test'.crypt('$1$1') != '$1$1$Bp8CU9Oujr9SSEw53WV6G.'
# JRuby < 1.7.17
Expand All @@ -49,6 +51,6 @@
raise Puppet::ParseError, 'system does not support enhanced salts'
end
else
password.crypt("$#{hash_type}$#{args[2]}")
password.crypt(salt)
end
end