Jira (PUP-11202) managehome=true on Windows fails

6 views
Skip to first unread message

Luchian Nemes (Jira)

unread,
Aug 6, 2021, 9:39:03 AM8/6/21
to puppe...@googlegroups.com
Luchian Nemes created an issue
 
Puppet / Bug PUP-11202
managehome=true on Windows fails
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2021/08/06 6:38 AM
Priority: Normal Normal
Reporter: Luchian Nemes

Docs state support for the managehome parameter of user resource on Windows but it does not seem to work, as seen below:

> puppet resource user 'test' ensure=present
Notice: /User[test]/ensure: created
user { 'test':
  ensure   => 'present',
  provider => 'windows_adsi',
}
 
> puppet resource user 'test' ensure=absent managehome=true
Error: Could not set 'absent' on ensure: (in OLE method `Delete': )
    OLE error code:80070002 in SWbemServicesEx
      The system cannot find the file specified.
    HRESULT error code:0x80020009
      Exception occurred.
Error: Could not set 'absent' on ensure: (in OLE method `Delete': )
    OLE error code:80070002 in SWbemServicesEx
      The system cannot find the file specified.
    HRESULT error code:0x80020009
      Exception occurred.
Wrapped exception:
(in OLE method `Delete': )
    OLE error code:80070002 in SWbemServicesEx
      The system cannot find the file specified.
    HRESULT error code:0x80020009
      Exception occurred.
Error: /User[test]/ensure: change from 'present' to 'absent' failed: Could not set 'absent' on ensure: (in OLE method `Delete': )
    OLE error code:80070002 in SWbemServicesEx
      The system cannot find the file specified.
    HRESULT error code:0x80020009
      Exception occurred.
user { 'test':
  ensure   => 'absent',
  provider => 'windows_adsi',
}
 
> puppet --version
7.9.0

Also, even though home is a user property it's not always populated:

From: C:/Program Files/Puppet Labs/Puppet/puppet/lib/ruby/vendor_ruby/puppet/provider/user/windows_adsi.rb @ line 129 windows_adsi#home:
 
    128: def home
 => 129:   require 'pry'; binding.pry
    130:   user['HomeDirectory']
    131: end
[1] pry(#<Puppet::Type::User::ProviderWindows_adsi>)> user
=> #<Puppet::Util::Windows::ADSI::User:0x0000000006548890 @name="Administrator", @native_object=nil>
[2] pry(#<Puppet::Type::User::ProviderWindows_adsi>)> user['HomeDirectory']
=> ""
[3] pry(#<Puppet::Type::User::ProviderWindows_adsi>)> continue
 
From: C:/Program Files/Puppet Labs/Puppet/puppet/lib/ruby/vendor_ruby/puppet/provider/user/windows_adsi.rb @ line 129 windows_adsi#home:
 
    128: def home
 => 129:   require 'pry'; binding.pry
    130:   user['HomeDirectory']
    131: end
[1] pry(#<Puppet::Type::User::ProviderWindows_adsi>)> user
=> #<Puppet::Util::Windows::ADSI::User:0x0000000006f23b30 @name="cyg_server", @native_object=nil>
[2] pry(#<Puppet::Type::User::ProviderWindows_adsi>)> user['HomeDirectory']
=> "C:\\cygwin64\\var\\empty"

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Gheorghe Popescu (Jira)

unread,
Aug 16, 2021, 10:36:03 AM8/16/21
to puppe...@googlegroups.com
Gheorghe Popescu assigned an issue to Luchian Nemes
Change By: Gheorghe Popescu
Assignee: Luchian Nemes

Ciprian Badescu (Jira)

unread,
Oct 1, 2021, 9:43:02 AM10/1/21
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages