class Inspec::Resources::FreeBSDUser

FreeBSD recommends to use the 'pw' command for user management @see: www.freebsd.org/doc/handbook/users-synopsis.html @see: www.freebsd.org/cgi/man.cgi?pw(8) It offers the following commands:

Public Instance Methods

meta_info(username) click to toggle source
# File lib/inspec/resources/users.rb, line 594
def meta_info(username)
  cmd = inspec.command("pw usershow #{username} -7")
  return nil if cmd.exit_status != 0

  # returns: root:*:0:0:Charlie &:/root:/bin/csh
  passwd = parse_passwd_line(cmd.stdout.chomp)
  {
    home: passwd["home"],
    shell: passwd["shell"],
  }
end