inspec/lib/resources
Adam Leff 1ea06ac3ea Change host resource to use getent ahosts on Linux (#2002)
* Change host resource to use getent ahosts on Linux

In InSpec 1.31, we changed the `host` resource to use `dig` instead of `getent
hosts` for name resolution because `getent hosts` does not return all entries
(only the first v6 entry if it exists, then the first v4 entry) and we wanted to
keep the Darwin and Linux implementation as close as possible. Unfortunately,
this affected users' ability to do resolution checks for entried stored in their
/etc/hosts file.

This change goes back to using `getent` for Linux and changes to `getent ahosts`
which returns both v4 and v6 records. Additionally, the Darwin provider's dig
implementation was reordered to return v4 addresses before v6 addresses to be
consistent with how `getent ahosts` returns records.

Signed-off-by: Adam Leff <adam@leff.co>

* Update unit tests for resolve_with_getent with proper output

Signed-off-by: Adam Leff <adam@leff.co>
2017-07-11 21:32:52 +02:00
..
apache.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
apache_conf.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
apt.rb improved regex for matching deb sources 2016-11-09 11:10:46 -06:00
audit_policy.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
auditd_conf.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
auditd_rules.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
bash.rb remodel bash and shell wrappers 2016-04-18 11:48:42 -04:00
bond.rb rename SimpleConfig / parse_config / parse_config_file options 2017-04-26 23:18:40 +02:00
bridge.rb Address rubocop violations 2017-02-08 16:49:16 -06:00
command.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
crontab.rb Support special cases for crontab resource 2017-06-06 15:12:12 +02:00
csv.rb Fix ObjectTraverser when accessing array values 2017-03-15 11:35:55 +01:00
dh_params.rb Fix #1617 Add dh_params resource (#1618) 2017-04-04 10:34:09 -04:00
directory.rb Fix directory resource output and exists check (#1950) 2017-06-23 07:44:15 -07:00
docker.rb optimize for docker 1.13 (#1966) 2017-06-26 15:45:03 -04:00
docker_container.rb Docker resource (#1566) 2017-04-24 10:47:03 -04:00
docker_image.rb Docker resource (#1566) 2017-04-24 10:47:03 -04:00
etc_group.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
file.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
gem.rb Fix installed? check for gem resource 2017-05-22 15:34:01 -05:00
groups.rb Address rubocop violations 2017-02-08 16:49:16 -06:00
grub_conf.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
host.rb Change host resource to use getent ahosts on Linux (#2002) 2017-07-11 21:32:52 +02:00
http.rb Bump default timeouts for http resource 2017-05-29 15:07:49 -04:00
iis_app.rb Adds support for iis_app InSpec testing (#1905) 2017-06-15 11:13:07 +02:00
iis_site.rb add fallback syntax for serverspec tests 2016-12-15 16:16:17 +01:00
inetd_conf.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
ini.rb Placing all resources in the Inspec::Resources namespace 2016-03-08 13:40:16 -05:00
interface.rb small syntax fix to interface resource. 2017-05-31 00:20:42 -05:00
iptables.rb Placing all resources in the Inspec::Resources namespace 2016-03-08 13:40:16 -05:00
json.rb Address rubocop violations 2017-02-08 16:49:16 -06:00
kernel_module.rb kernel_module resource: added blacklisting, enabled, disabled, docs and unit tests (#1798) 2017-07-05 11:41:44 +02:00
kernel_parameter.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
key_rsa.rb refactor x509 resources and rsa key 2017-03-22 11:44:32 +01:00
limits_conf.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
login_def.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
mount.rb Add FreeBSD support for ZFS datasets and pools 2017-02-22 10:29:49 -07:00
mssql_session.rb oracle_session and mssql_session improvement (#1857) 2017-06-29 11:01:32 -04:00
mysql.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
mysql_conf.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
mysql_session.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
nginx_conf.rb add nginx_conf resource (#1889) 2017-06-26 06:37:41 -07:00
npm.rb Placing all resources in the Inspec::Resources namespace 2016-03-08 13:40:16 -05:00
ntp_conf.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
oneget.rb making the examples in the code consistent with rst docs 2016-09-21 11:33:17 +05:30
oracledb_session.rb oracle_session and mssql_session improvement (#1857) 2017-06-29 11:01:32 -04:00
os.rb making the examples in the code consistent with rst docs 2016-09-21 11:33:17 +05:30
os_env.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
package.rb Add rpm_dbpath support to the package resource (#1960) 2017-06-28 03:21:15 -07:00
packages.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
parse_config.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
passwd.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
pip.rb rename SimpleConfig / parse_config / parse_config_file options 2017-04-26 23:18:40 +02:00
port.rb Fix port resource for invalid IP address in netstat output 2017-03-29 08:33:50 +02:00
postgres.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
postgres_conf.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
postgres_hba_conf.rb New postgres_hba_conf resource (#1964) 2017-07-03 20:13:51 +02:00
postgres_ident_conf.rb New postgres_ident_conf resource (#1963) 2017-07-03 20:01:40 +02:00
postgres_session.rb updated postgres_session resource properly escape queries (#1939) 2017-07-03 08:10:27 +02:00
powershell.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
processes.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
rabbitmq_conf.rb add rabbitmq config resource 2017-04-12 20:51:12 +02:00
registry_key.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
security_policy.rb rename SimpleConfig / parse_config / parse_config_file options 2017-04-26 23:18:40 +02:00
service.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
shadow.rb fix the shadow password example now that cmp can handle arrays 2016-04-20 11:57:34 -04:00
ssh_conf.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
ssl.rb Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
sys_info.rb add support for hostname detection on macOS 2017-04-12 12:57:45 +02:00
toml.rb Adding toml resource (#1924) 2017-06-15 16:54:12 -04:00
users.rb rename SimpleConfig / parse_config / parse_config_file options 2017-04-26 23:18:40 +02:00
vbscript.rb fix integration tests for usage with winrm v2 2016-09-05 13:36:48 +02:00
virtualization.rb Add support for virtualization resource (#1803) 2017-06-07 14:10:29 +02:00
windows_feature.rb Update inspec for os[:family] change in Train 2016-08-04 13:32:35 +01:00
windows_task.rb Fixing errors reported in Travis 2016-11-20 20:32:48 +00:00
wmi.rb improve wmi resource 2016-06-19 23:40:45 +02:00
x509_certificate.rb refactor x509 resources and rsa key 2017-03-22 11:44:32 +01:00
xinetd.rb Fix xinetd resource failing when file cannot be read 2017-05-01 15:59:07 -05:00
yaml.rb Fix YAML resource documentation 2017-05-01 16:16:00 -05:00
yum.rb Remove method_missing, provide methods for repo metadata 2017-03-29 10:42:25 +02:00
zfs_dataset.rb Add FreeBSD support for ZFS datasets and pools 2017-02-22 10:29:49 -07:00
zfs_pool.rb Add FreeBSD support for ZFS datasets and pools 2017-02-22 10:29:49 -07:00