lynis/include
hlein 62d9a18861 A bunch of Solaris compatibility tweaks (#367)
* Work around Solaris' /bin/sh not being POSIX.

If /usr/xpg4/bin/sh is present, we are (definitely?) on Solaris or
a derivative, and /bin/sh cannot be trusted to support POSIX, but
/usr/xpg4/bin/sh can be.  Exec it right away.

* Work around Solaris 'which' command oddity.

Solaris' (at least) 'which' command outputs not-found errors to STDOUT
instead of STDERR.

This makes "did we get any output from which" checks insufficient;
piping to grep -v the "no foo in ..." message should work.

Note that this patch set includes all such uses of which that I could
find, including ones that should never be reached on Solaris (i.e. only
executed on some other OS) just for consistency.

* Improved alternate-sh exec to avoid looping.

* Solaris' /usr/ucb/echo supports -n.

* Check for the best hash type that openssl supports.

When using openssl to generate hashes, do not assume it supports
sha256; try that, then sha1, then give up and use md5.

* Solaris does not support sed -i; use a tempfile.

* Use the full path for modinfo.

When running as non-root, /usr/sbin/ might not be in PATH.
include/tests_accounting already calls modinfo by full path, but
include/tests_kernel did not.

* Solaris find does not support -maxdepth.

This mirrors the logic already in tests_homedirs.

* Use PSBINARY instead of ps.

* Work around Solaris' date not supporting +%s.

Printing nawk's srand value is a bizarre but apparently once popular
workaround for there being no normal userland command to print
UNIX epoch seconds.  A perl one-liner is the other common approach,
but nawk may be more reliably present on Solaris than perl.

* Revert to using sha1 for HOSTID.

* Whitespace cleanup for openssl hash tests.
2017-03-08 16:24:24 +00:00
..
binaries Various cleanups (#363) 2017-03-06 07:41:21 +00:00
consts Status of MongoDB instances 2017-02-10 13:07:53 +01:00
data_upload Changed date and preparing for release 2017-02-09 13:35:40 +01:00
functions A bunch of Solaris compatibility tweaks (#367) 2017-03-08 16:24:24 +00:00
helper_audit_dockerfile Various cleanups (#363) 2017-03-06 07:41:21 +00:00
helper_configure Changed date and preparing for release 2017-02-09 13:35:40 +01:00
helper_show A bunch of Solaris compatibility tweaks (#367) 2017-03-08 16:24:24 +00:00
helper_system_remote_scan A bunch of Solaris compatibility tweaks (#367) 2017-03-08 16:24:24 +00:00
helper_update A bunch of Solaris compatibility tweaks (#367) 2017-03-08 16:24:24 +00:00
osdetection A bunch of Solaris compatibility tweaks (#367) 2017-03-08 16:24:24 +00:00
parameters Various cleanups (#363) 2017-03-06 07:41:21 +00:00
profiles Code enhancements and allow host alias to be defined in profile 2017-03-05 20:45:13 +01:00
report Various cleanups (#363) 2017-03-06 07:41:21 +00:00
tests_accounting Changed date and preparing for release 2017-02-09 13:35:40 +01:00
tests_authentication A bunch of Solaris compatibility tweaks (#367) 2017-03-08 16:24:24 +00:00
tests_banners Various cleanups (#363) 2017-03-06 07:41:21 +00:00
tests_boot_services Lots of cleanups (#366) 2017-03-07 19:23:08 +00:00
tests_containers Various cleanups (#363) 2017-03-06 07:41:21 +00:00
tests_crypto Changed date and preparing for release 2017-02-09 13:35:40 +01:00
tests_custom.template Extended example 2016-08-13 10:48:35 +02:00
tests_databases Various cleanups (#363) 2017-03-06 07:41:21 +00:00
tests_file_integrity Lots of cleanups (#366) 2017-03-07 19:23:08 +00:00
tests_file_permissions Changed date and preparing for release 2017-02-09 13:35:40 +01:00
tests_filesystems Various cleanups (#363) 2017-03-06 07:41:21 +00:00
tests_firewalls Lots of cleanups (#366) 2017-03-07 19:23:08 +00:00
tests_hardening [HRDN-7222] changed reporting key 2017-02-14 15:08:55 +01:00
tests_homedirs Changed date and preparing for release 2017-02-09 13:35:40 +01:00
tests_insecure_services Changed date and preparing for release 2017-02-09 13:35:40 +01:00
tests_kernel A bunch of Solaris compatibility tweaks (#367) 2017-03-08 16:24:24 +00:00
tests_kernel_hardening Changed date and preparing for release 2017-02-09 13:35:40 +01:00
tests_ldap Changed date and preparing for release 2017-02-09 13:35:40 +01:00
tests_logging Various cleanups (#363) 2017-03-06 07:41:21 +00:00
tests_mac_frameworks Lots of cleanups (#366) 2017-03-07 19:23:08 +00:00
tests_mail_messaging New test and reduction of output on screen 2017-02-28 20:17:01 +01:00
tests_malware Changed date and preparing for release 2017-02-09 13:35:40 +01:00
tests_memory_processes Changed date and preparing for release 2017-02-09 13:35:40 +01:00
tests_nameservices A bunch of Solaris compatibility tweaks (#367) 2017-03-08 16:24:24 +00:00
tests_networking Lots of cleanups (#366) 2017-03-07 19:23:08 +00:00
tests_php Add /usr/local/etc/zend/php.ini as possible php path (#360) 2017-03-01 14:31:20 +00:00
tests_ports_packages A bunch of Solaris compatibility tweaks (#367) 2017-03-08 16:24:24 +00:00
tests_printers_spools Lots of cleanups (#366) 2017-03-07 19:23:08 +00:00
tests_scheduling A bunch of Solaris compatibility tweaks (#367) 2017-03-08 16:24:24 +00:00
tests_shells A bunch of Solaris compatibility tweaks (#367) 2017-03-08 16:24:24 +00:00
tests_snmp Changed date and preparing for release 2017-02-09 13:35:40 +01:00
tests_solaris Various cleanups (#363) 2017-03-06 07:41:21 +00:00
tests_squid Lots of cleanups (#366) 2017-03-07 19:23:08 +00:00
tests_ssh Lots of cleanups (#366) 2017-03-07 19:23:08 +00:00
tests_storage Various cleanups (#363) 2017-03-06 07:41:21 +00:00
tests_storage_nfs Various cleanups (#363) 2017-03-06 07:41:21 +00:00
tests_system_integrity Changed date and preparing for release 2017-02-09 13:35:40 +01:00
tests_time Various cleanups (#363) 2017-03-06 07:41:21 +00:00
tests_tooling A bunch of Solaris compatibility tweaks (#367) 2017-03-08 16:24:24 +00:00
tests_virtualization Changed date and preparing for release 2017-02-09 13:35:40 +01:00
tests_webservers Various cleanups (#363) 2017-03-06 07:41:21 +00:00
tool_tips Various cleanups (#363) 2017-03-06 07:41:21 +00:00