Jira (PUP-5821) Cannot Execute PowerShell Command as Unicode User

2 views
Skip to first unread message

Ryan Gard (JIRA)

unread,
Feb 4, 2016, 7:20:03 PM2/4/16
to puppe...@googlegroups.com
Ryan Gard created an issue
 
Puppet / Bug PUP-5821
Cannot Execute PowerShell Command as Unicode User
Issue Type: Bug Bug
Assignee: Unassigned
Components: Windows
Created: 2016/02/04 4:19 PM
Environment:

Puppet Agent: Puppet Agent
Agent Platform: Windows 2012R2 x64

Labels: windows
Priority: Normal Normal
Reporter: Ryan Gard

Description

If a user with Unicode name attempts to run a manifest that calls PowerShell it will result in a failure:

Could not retrieve fact='package_provider', resolution='<anonymous>': Malformed version number string 3.8.2 (Puppet Enterprise 3.8.2)

Attachments

  • None.

Automated Repro Steps

  1. Install Puppet Agent on SUT.
  2. Install Chinese language pack and keyboard on SUT.
  3. Create user "你好吗".
  4. Logoff and login as "你好吗".
  5. Create the manifest "C:\test.pp" on the SUT with the following content:

    exec { 'tomcat-configure-service':
      command  => "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe Get-ChildItem Env:",
      onlyif   => "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe exit 0",
      provider => windows,
      logoutput => true,
      tag      => 'tomcat-configure-service',
    }

  6. Open a Puppet Console session. (IN CURRENT USER CONTEXT!)
  7. Change console font to "Lucidia Console". (Puppet will crash otherwise. PUP-5717 )
  8. Change codepage:

    chcp 65001

  9. Execute the following command on the SUT:

    puppet apply c:\test.pp --trace

Expect

Puppet should compile and run the manifest successfully.

Actual

Puppet fails:

C:\Users\你好吗>chcp 65001
Active code page: 65001
 
C:\Users\你好吗>puppet apply c:\test.pp
Error: Could not initialize global default settings: Invalid argument @ dir_s_mk
dir - C:/Users/???
 
C:\Users\你好吗>puppet apply c:\test.pp --trace
Error: Could not initialize global default settings: Invalid argument @ dir_s_mk
dir - C:/Users/???
C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/2.1.0/fileutils.rb:250:in
`mkdir'
C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/2.1.0/fileutils.rb:250:in
`fu_mkdir'
C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/2.1.0/fileutils.rb:224:in
`block (2 levels) in mkdir_p'
C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/2.1.0/fileutils.rb:222:in
`reverse_each'
C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/2.1.0/fileutils.rb:222:in
`block in mkdir_p'
C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/2.1.0/fileutils.rb:208:in
`each'
C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/2.1.0/fileutils.rb:208:in
`mkdir_p'
C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/settings.rb:358:in `create
_ancestors'
C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/settings.rb:343:in `block
in initialize_app_defaults'
C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/settings.rb:342:in `each'
C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/settings.rb:342:in `initia
lize_app_defaults'
C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet.rb:135:in `do_initialize_s
ettings_for_run_mode'
C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet.rb:127:in `initialize_sett
ings'
C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/command_line.rb:67:in
 `block in execute'
C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util.rb:491:in `exit_on_fa
il'
C:/Program Files/Puppet Labs/Puppet/puppet/lib/puppet/util/command_line.rb:66:in
 `execute'
C:/Program Files/Puppet Labs/Puppet/puppet/bin/puppet:5:in `<main>'

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.12#64027-sha1:e3691cc)
Atlassian logo

Ryan Gard (JIRA)

unread,
Feb 4, 2016, 7:21:03 PM2/4/16
to puppe...@googlegroups.com
Ryan Gard updated an issue
Change By: Ryan Gard
h1. Description


If a user with Unicode name attempts to run a manifest that calls PowerShell it will result in a failure:

{noformat} Error: Could not  retrieve fact='package_provider', resolution='<anonymous>'  initialize global default settings :  Malformed version number string 3.8.2 (Puppet Enterprise 3.8.2)  Invalid argument @ dir_s_mk
dir - C:/Users/???
{noformat}

h2. Attachments

* None.

h2. Automated Repro Steps

# Install [Puppet Agent|http://nightlies.puppetlabs.com/puppet-agent/ec1f5692fa407d8b7e24e5eb6b6df7ff89288479/repos/windows/] on SUT.
# Install Chinese language pack and keyboard on SUT.
# Create user "你好吗".
# Logoff and login as "你好吗".
# Create the manifest "C:\test.pp" on the SUT with the following content:
{noformat}exec { 'tomcat-configure-service':

  command  => "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe Get-ChildItem Env:",
  onlyif   => "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe exit 0",
  provider => windows,
  logoutput => true,
  tag      => 'tomcat-configure-service',
}{noformat}
# Open a Puppet Console session. (IN CURRENT USER CONTEXT!)
# Change console font to "Lucidia Console". (Puppet will crash otherwise. PUP-5717)
# Change codepage:
{noformat}chcp 65001{noformat}
# Execute the following command on the SUT:
{noformat}puppet apply c:\test.pp --trace{noformat}

h2. Expect


Puppet should compile and run the manifest successfully.

h2. Actual

Puppet fails:

{noformat}C:\Users\你好吗>chcp 65001
{noformat}

Ryan Gard (JIRA)

unread,
Feb 4, 2016, 7:21:07 PM2/4/16
to puppe...@googlegroups.com
Ryan Gard updated an issue
Change By: Ryan Gard
Environment: Puppet Agent: [ Puppet Agent ec1f5692fa407d8b7e24e5eb6b6df7ff89288479 |http://nightlies.puppetlabs.com/puppet-agent/ec1f5692fa407d8b7e24e5eb6b6df7ff89288479/repos/windows/]

Agent Platform: Windows 2012R2 x64

Ryan Gard (JIRA)

unread,
Feb 5, 2016, 1:13:03 PM2/5/16
to puppe...@googlegroups.com
Ryan Gard updated an issue
h1. Description

If a user with Unicode name attempts to run a manifest that calls PowerShell it will result in a failure:

{noformat}Error: Could not initialize global default settings: Invalid argument @ dir_s_mk
dir - C:/Users/???{noformat}

h2. Attachments

* None.

h2.
 Automated Repro  Reproduction  Steps

Ryan Gard (JIRA)

unread,
May 24, 2016, 5:02:10 PM5/24/16
to puppe...@googlegroups.com
Ryan Gard updated an issue
Change By: Ryan Gard
QA Contact: Ryan Gard
This message was sent by Atlassian JIRA (v6.4.13#64028-sha1:b7939e9)
Atlassian logo

Larissa Lane (JIRA)

unread,
May 24, 2016, 6:22:04 PM5/24/16
to puppe...@googlegroups.com
Larissa Lane updated an issue
Change By: Larissa Lane
Labels: i18n utf-8 windows

Henrik Lindberg (JIRA)

unread,
May 16, 2017, 8:36:02 AM5/16/17
to puppe...@googlegroups.com
Henrik Lindberg updated an issue
Change By: Henrik Lindberg
Labels: i18n  triaged  utf-8 windows
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Josh Cooper (Jira)

unread,
Mar 5, 2020, 3:12:04 AM3/5/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-5821
 
Re: Cannot Execute PowerShell Command as Unicode User

This is also resolved

C:\Windows\system32>whoami
cozy-teacher\你好吗
 
C:\Windows\system32>puppet apply manifest.pp
Notice: Compiled catalog for cozy-teacher.delivery.puppetlabs.net in environment production in 0.11 seconds
Notice: /Stage[main]/Main/Exec[tomcat-configure-service]/returns:
Notice: /Stage[main]/Main/Exec[tomcat-configure-service]/returns: Name                           Value            
...

This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages