-
Notifications
You must be signed in to change notification settings - Fork 270
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
windows_http_acl does not work on non-English Windows #379
Comments
I just looked into http_acl.rb and noticed that getCurrentAcl is parsing netsh output and looking for the string "User:". Using German Windows, this would be "Benutzer:" def getCurrentAcl
cmd = shell_out!("#{@command} http show urlacl url=#{@current_resource.url}")
Chef::Log.debug "netsh reports: #{cmd.stdout}"
m = cmd.stdout.scan(/User:\s*(.+)/)
... |
seems like we need to find another API to get this info in a language agnostic format |
To get around this issue in my case I put the http_acl stuff into a new cookbook and wrote a library for getting current urlacl using Windows-API via FFI. |
chef core already depends and makes ample use of it. I for one would be very open to reviewing such a PR. |
Best way to share would probably be creating a fork and moving my changes to that fork, followed by a pull request, right? (sorry for that github-beginner-question ;-) ) |
No worries. Thats exactly right. |
Cookbook version
1.39.2
Chef-client version
12.9.38
Platform Details
Windows 7 Enterprise (German)
Scenario:
When trying to use the windows_http_acl resource, it fails while checking if the requested URL is already registered.
This works fine, if I use an English Windows or an English language pack and switch language to English for the current user.
Steps to Reproduce:
Install some non-English language pack (i.e. German) and switch current users language settings to that language. Try running a recipe with windows_http_acl resource used.
Expected Result:
windows_http_acl should not fail, but successfully register the requested URL
Actual Result:
Generated at 2016-07-14 16:52:25 +0200
Mixlib::ShellOut::ShellCommandFailed: windows_http_acl[http://+:8086/](cp_suite_drop::zip line 60) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of C:\Windows\system32\netsh.exe http add urlacl url=http://+:8086/ user="Jeder" ----
STDOUT: Die URL-Reservierung konnte nicht hinzugef�gt werden. Fehler: 183
Eine Datei kann nicht erstellt werden, wenn sie bereits vorhanden ist.
STDERR:
---- End output of C:\Windows\system32\netsh.exe http add urlacl url=http://+:8086/ user="Jeder" ----
The text was updated successfully, but these errors were encountered: