Jira (PUP-10898) Get fully qualified current domain user name

52 views
Skip to first unread message

Luchian Nemes (Jira)

unread,
Feb 11, 2021, 9:55:04 AM2/11/21
to puppe...@googlegroups.com
Luchian Nemes created an issue
 
Puppet / Task PUP-10898
Get fully qualified current domain user name
Issue Type: Task Task
Affects Versions: PUP 6.14.0
Assignee: Luchian Nemes
Created: 2021/02/11 6:54 AM
Priority: Normal Normal
Reporter: Luchian Nemes

In some cases, looking up non fully qualified user names (just 'name' instead of 'DOMAIN
name
') on Windows does not work. In this case, Puppet Agent fails with Error: Failed to apply catalog: undefined method `bytesize' for nil:NilClass.

 

The issue was narrowed down to https://github.com/puppetlabs/puppet/blob/main/lib/puppet/util/windows/principal.rb#L47 which silently fails with Failed to get user name: No mapping between account names and security IDs was done.

 

Using https://docs.microsoft.com/en-us/windows/win32/api/secext/nf-secext-getusernameexw instead of https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getusernamew in https://github.com/puppetlabs/puppet/blob/main/lib/puppet/util/windows/adsi.rb#L489 or https://github.com/puppetlabs/puppet/blob/6.x/lib/puppet/file_system/windows.rb#L130 with the correct format should sove the issue.

 

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Luchian Nemes (Jira)

unread,
Feb 11, 2021, 9:56:02 AM2/11/21
to puppe...@googlegroups.com
Luchian Nemes updated an issue
Change By: Luchian Nemes
In some cases, looking up non fully qualified user names (just '*name*' instead of '*DOMAIN \\ * * name*') on Windows does not work. In this case, Puppet Agent fails with *Error: Failed to apply catalog: undefined method `bytesize' for nil:NilClass*.

 

The issue was narrowed down to [https://github.com/puppetlabs/puppet/blob/main/lib/puppet/util/windows/principal.rb#L47] which silently fails with *Failed to get user name: No mapping between account names and security IDs was done.*

Luchian Nemes (Jira)

unread,
Feb 11, 2021, 10:42:02 AM2/11/21
to puppe...@googlegroups.com
Luchian Nemes assigned an issue to Unassigned
Change By: Luchian Nemes
Assignee: Luchian Nemes

zendesk.jira (Jira)

unread,
Feb 12, 2021, 1:20:03 AM2/12/21
to puppe...@googlegroups.com
zendesk.jira updated an issue
Change By: zendesk.jira
Labels: jira_escalated

zendesk.jira (Jira)

unread,
Feb 12, 2021, 1:20:04 AM2/12/21
to puppe...@googlegroups.com
zendesk.jira updated an issue
Change By: zendesk.jira
Zendesk Ticket Count: 1
Zendesk Ticket IDs: 42708

Mihai Buzgau (Jira)

unread,
Feb 15, 2021, 1:48:03 AM2/15/21
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
 
Puppet / Improvement PUP-10898
Change By: Mihai Buzgau
Issue Type: Task Improvement

Mihai Buzgau (Jira)

unread,
Feb 17, 2021, 6:44:02 AM2/17/21
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Team: Night's Watch

Mihai Buzgau (Jira)

unread,
Feb 17, 2021, 6:44:03 AM2/17/21
to puppe...@googlegroups.com
Mihai Buzgau updated an issue
Change By: Mihai Buzgau
Sprint: NW - 2021-03-03

Gheorghe Popescu (Jira)

unread,
Feb 17, 2021, 6:46:05 AM2/17/21
to puppe...@googlegroups.com

Luchian Nemes (Jira)

unread,
Feb 23, 2021, 3:12:02 AM2/23/21
to puppe...@googlegroups.com
Luchian Nemes assigned an issue to Luchian Nemes
Change By: Luchian Nemes
Assignee: Luchian Nemes

Josh Cooper (Jira)

unread,
Mar 1, 2021, 2:52:01 PM3/1/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 7.5.0

Josh Cooper (Jira)

unread,
Mar 1, 2021, 2:53:01 PM3/1/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 6.22.0

Josh Cooper (Jira)

unread,
Mar 2, 2021, 7:18:56 PM3/2/21
to puppe...@googlegroups.com
Josh Cooper commented on Improvement PUP-10898
 
Re: Get fully qualified current domain user name

Merged to 6.x in ce0216f31f, passed CI in 2056487938

Luchian Nemes (Jira)

unread,
Mar 3, 2021, 2:16:01 AM3/3/21
to puppe...@googlegroups.com
Luchian Nemes updated an issue
 
Change By: Luchian Nemes
Release Notes: Bug Fix
Release Notes Summary: Retrieving the current user name SID on Windows was causing Puppet to fail in certain scenarios where the user was from a secondary domain controller. A fallback mechanism was implemented to use the fully qualified domain name for lookup.

Claire Cadman (Jira)

unread,
Mar 10, 2021, 10:36:02 AM3/10/21
to puppe...@googlegroups.com
Claire Cadman updated an issue
Change By: Claire Cadman
Labels: doc_reviewed jira_escalated
Reply all
Reply to author
Forward
0 new messages