-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upcoming Puppet 4 / Ruby 2.1.5 Registry compatibility changes #8
Comments
Also see #6 when we had to address similar issues. |
@Iristyle Thanks, as before, for the very detailed issue. Looking into making the suggested fixes. |
Bug exists in ruby 2.1.5 which passes wide strings to ANSI API. Instead, invoke RegDeleteValueW directly. closes #8
Will wait for Puppet 4 builds to test on before merging. |
Left one comment for you on 41ae24e @badgerious. |
@badgerious Do you think this will be released soon? |
thanks for the reminder @ferventcoder - I also just filed the enumeration issue with Ruby at https://bugs.ruby-lang.org/issues/11410 |
@ferventcoder Slipped off the radar (clearly :) !). I need to put together a Puppet 4 test environment to give it a run and then I'll cut a release. |
@badgerious awesome, thank you |
|
@ferventcoder Cool. Based on the way you're using windows_env, you may want to have a look at #11, a long standing issue I've not bothered to address since no one has complained. But it might affect you here. |
As part of making Puppet 4 compatible with Ruby 2.1.5, we have discovered a couple of bugs inside Ruby that will affect your module. The two primary issues are:
#each_key
/#keys
or values with#each_value
/#values
, Ruby will take aUTF-16LE
string and roundtrip it through the local codepage unnecessarily, which may cause encoding exceptions. Our prime example of this is when a Unicode en-dashU+2013
appears in a registry value, and the local codepage isIBM437
, which has no equivalent character. This is just one of many potential examples that may trigger this behavior. NOTE: Normal registry reads of a value at a particular key are not problematic - the bad behavior is only triggered during enumeration. We have not yet filed this bug with Ruby.#delete_key
and#delete_value
methods, Ruby is passing wide characterUTF-16LE
strings to ANSI APIs. We have filed this bug with Ruby at https://bugs.ruby-lang.org/issues/10820There are additional technical details that can be found in PUP-3837, the ticket we're using to track changes that we've made to Puppet. Our resolution for these issues was merged to Puppet at puppetlabs/puppet@c610cd0
We don't have Puppet 4 builds released yet, but keep an eye on https://groups.google.com/forum/#!forum/puppet-announce
I have identified issues with the code in this module that will require some updating to ensure it maintains compatibility with both existing Puppet releases and the upcoming releases. I'm getting in touch with you now, so that you're not caught off guard, and so that your module is ready to go by the time 4.0 ships.
Issues:
delete_value
is called at https://github.com/badgerious/puppet-windows-env/blob/master/lib/puppet/provider/windows_env/windows_env.rb#L196 and should instead use an internal definition for theRegDeleteValueW
API call like we've done inside Puppet.registry.rb
, present atc:\tools\ruby215\lib\ruby\2.1.0\win32\registry.rb
in my install. Some simple warnings may be emitted in several locations where problematic behavior can occur. Then you can exercise your module / run specs for a full validation.puts "BUG: RegDeleteValue called with #{name} against #{@keyname}"
puts "BUG: RegDeleteKey called with #{name} against #{@keyname}"
addedputs "BUG: export_string triggered with #{str} to #{enc.to_s}"
puts "BUG: expand_environ triggered with #{str}"
- while this behavior does trigger a string re-encode to the current codepage, we view it as less problematic as it requiresREG_MULTI_SZ
and environment variable expansion - where the values will typically be in the current codepage on a default system.We will be making an announcement to the puppet-dev list shortly mentioning some of these upcoming changes.
https://groups.google.com/forum/#!forum/puppet-dev
Let me know if you have any questions.
Thanks!
The text was updated successfully, but these errors were encountered: