File tree Expand file tree Collapse file tree
lib/puppet/parser/functions Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3232 password = args [ 0 ] . to_s
3333 return nil if password . empty?
3434
35- # work around JRuby bug in String#crypt for JRuby < 1.7.17
36- if RUBY_PLATFORM == 'java' and 'test' . crypt ( '$1$1' ) != '$1$1$Bp8CU9Oujr9SSEw53WV6G.'
37- def password . crypt ( salt )
38- # puppetserver bundles Apache Commons Codec
39- org . apache . commons . codec . digest . Crypt . crypt ( self . to_java_bytes , salt )
35+ # handle weak implementations of String#crypt
36+ if 'test' . crypt ( '$1$1' ) != '$1$1$Bp8CU9Oujr9SSEw53WV6G.'
37+ # JRuby < 1.7.17
38+ if RUBY_PLATFORM == 'java'
39+ # override String#crypt for password variable
40+ def password . crypt ( salt )
41+ # puppetserver bundles Apache Commons Codec
42+ org . apache . commons . codec . digest . Crypt . crypt ( self . to_java_bytes , salt )
43+ end
44+ else
45+ # MS Windows and other systems that don't support enhanced salts
46+ raise Puppet ::ParseError , 'system does not support enhanced salts'
4047 end
4148 end
4249 password . crypt ( "$#{ args [ 1 ] } $#{ args [ 2 ] } " )
You can’t perform that action at this time.
0 commit comments