mirror of
https://github.com/inspec/inspec
synced 2024-11-23 13:13:22 +00:00
Add windows user SID as 'UID' in user resource. Fix #960
This commit is contained in:
parent
8de1b9fe7b
commit
89976219b9
1 changed files with 7 additions and 7 deletions
|
@ -448,18 +448,18 @@ module Inspec::Resources
|
|||
return nil
|
||||
end
|
||||
|
||||
user = params['User']['Caption'] unless params['User'].nil?
|
||||
groups = params['Groups']
|
||||
user_hash = params['User'] || {}
|
||||
group_hashes = params['Groups'] || []
|
||||
# if groups is no array, generate one
|
||||
groups = [groups] if !groups.is_a?(Array)
|
||||
groups = groups.map { |grp| grp['Caption'] } unless params['Groups'].nil?
|
||||
group_hashes = [group_hashes] unless group_hashes.is_a?(Array)
|
||||
group_names = group_hashes.map { |grp| grp['Caption'] }
|
||||
|
||||
{
|
||||
uid: nil,
|
||||
user: user,
|
||||
uid: user_hash['SID'],
|
||||
user: user_hash['Caption'],
|
||||
gid: nil,
|
||||
group: nil,
|
||||
groups: groups,
|
||||
groups: group_names,
|
||||
}
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue