You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cat /etc/passwd
##
# User Database
#
# Note that this file is consulted directly only when the system is running
# in single-user mode. At other times this information is provided by
# Open Directory.
#
# See the opendirectoryd(8) man page for additional information about
# Open Directory.
##
nobody:*:-2:-2:Unprivileged User:/var/empty:/usr/bin/false
I would expect that the comments are not parsed as users:
$ inspec shell
Welcome to the interactive InSpec Shell
To find out how to use it, type: help
inspec> passwd.users
=> ["##",
"# User Database",
"# ",
"# Note that this file is consulted directly only when the system is running",
"# in single-user mode. At other times this information is provided by",
"# Open Directory.",
"#",
"# See the opendirectoryd(8) man page for additional information about",
"# Open Directory.",
"##",
"nobody",
...]
inspec>
Description
I would expect that the comments are not parsed as users:
InSpec and Platform Version
Mac OS 10.10
InSpec 0.20.1
Replication Case
Ensure the
/etc/passwd
includes comments.Possible Solutions
Extend https://github.com/chef/inspec/blob/master/lib/utils/parser.rb#L20 to handle comments properly
The text was updated successfully, but these errors were encountered: