File tree 1 file changed +5
-5
lines changed
lib/puppet/parser/functions
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 76
76
77
77
# handle weak implementations of String#crypt
78
78
# dup the string to get rid of frozen status for testing
79
- if ( +'test' ) . crypt ( '$1$1' ) == '$1$1$Bp8CU9Oujr9SSEw53WV6G.'
79
+ if RUBY_PLATFORM == 'java'
80
+ # puppetserver bundles Apache Commons Codec
81
+ org . apache . commons . codec . digest . Crypt . crypt ( password . to_java_bytes , salt )
82
+ elsif ( +'test' ) . crypt ( '$1$1' ) == '$1$1$Bp8CU9Oujr9SSEw53WV6G.'
80
83
password . crypt ( salt )
81
84
else
82
85
# JRuby < 1.7.17
83
86
# MS Windows and other systems that don't support enhanced salts
84
- raise Puppet ::ParseError , 'system does not support enhanced salts' unless RUBY_PLATFORM == 'java'
85
-
86
- # puppetserver bundles Apache Commons Codec
87
- org . apache . commons . codec . digest . Crypt . crypt ( password . to_java_bytes , salt )
87
+ raise Puppet ::ParseError , 'system does not support enhanced salts'
88
88
end
89
89
end
You can’t perform that action at this time.
0 commit comments