mirror of
https://github.com/inspec/inspec
synced 2024-11-27 15:10:44 +00:00
modify etc_group to return complete group info
This commit is contained in:
parent
537728b41b
commit
9fb51b44a2
1 changed files with 15 additions and 0 deletions
|
@ -103,6 +103,13 @@ class EtcGroup < Vulcano.resource(1)
|
||||||
}
|
}
|
||||||
line, _idx_nl = parse_comment_line(line, opts)
|
line, _idx_nl = parse_comment_line(line, opts)
|
||||||
line.split(':')
|
line.split(':')
|
||||||
|
# x = line.split(':')
|
||||||
|
# {
|
||||||
|
# 'name' => x.at(0), # Name of the group.
|
||||||
|
# 'password' => x.at(1), # Group's encrypted password.
|
||||||
|
# 'gid' => convert_to_i(x.at(2)), # The group's decimal ID.
|
||||||
|
# 'members' => x.at(3), # Group members.
|
||||||
|
# }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -113,14 +120,22 @@ class EtcGroupView
|
||||||
@filter = filter
|
@filter = filter
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# returns the group object
|
||||||
def groups
|
def groups
|
||||||
|
@filter
|
||||||
|
end
|
||||||
|
|
||||||
|
# only returns group name
|
||||||
|
def group_names
|
||||||
@parent.groups(@filter)
|
@parent.groups(@filter)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# only return gids
|
||||||
def gids
|
def gids
|
||||||
@parent.gids(@filter)
|
@parent.gids(@filter)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# only returns users
|
||||||
def users
|
def users
|
||||||
@parent.users(@filter)
|
@parent.users(@filter)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue