mirror of
https://github.com/inspec/inspec
synced 2024-11-23 21:23:29 +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
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
user = params['User']['Caption'] unless params['User'].nil?
|
user_hash = params['User'] || {}
|
||||||
groups = params['Groups']
|
group_hashes = params['Groups'] || []
|
||||||
# if groups is no array, generate one
|
# if groups is no array, generate one
|
||||||
groups = [groups] if !groups.is_a?(Array)
|
group_hashes = [group_hashes] unless group_hashes.is_a?(Array)
|
||||||
groups = groups.map { |grp| grp['Caption'] } unless params['Groups'].nil?
|
group_names = group_hashes.map { |grp| grp['Caption'] }
|
||||||
|
|
||||||
{
|
{
|
||||||
uid: nil,
|
uid: user_hash['SID'],
|
||||||
user: user,
|
user: user_hash['Caption'],
|
||||||
gid: nil,
|
gid: nil,
|
||||||
group: nil,
|
group: nil,
|
||||||
groups: groups,
|
groups: group_names,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue