#!/bin/sh

#################################################################################
#
#   Lynis
# ------------------
#
# Copyright 2007-2008, Michael Boelen (michael@rootkit.nl), The Netherlands
# Web site: http://www.rootkit.nl
#
# Lynis comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
# welcome to redistribute it under the terms of the GNU General Public License.
# See LICENSE file for usage of this software.
#
#################################################################################
#
    InsertSection "Accounting"

    # Test        : ACCT-2754
    # Description : Check availability FreeBSD accounting data
    Register --test-no ACCT-2754 --os FreeBSD --weight L --network NO --description "Check for available FreeBSD accounting information"
    if [ ${SKIPTEST} -eq 0 ]; then
        if [ -f /var/account/acct ]; then
	    Display --indent 2 --text "- Checking accounting information..." --result OK --color GREEN
            logtext "Result: /var/account/acct available"
          else
	    Display --indent 2 --text "- Checking accounting information..." --result "NOT FOUND" --color YELLOW
            logtext "Result: No accounting information available (/var/account/acct does not exist)"
            logtext "Remark: Possibly there is another location where the accounting data is stored"
        fi
    fi
#
#################################################################################
#
    # Test        : ACCT-9622
    # Description : Check availability Linux accounting data
    Register --test-no ACCT-9622 --os Linux --weight L --network NO --description "Check for available Linux accounting information"
    if [ ${SKIPTEST} -eq 0 ]; then
        logtext "Test: Check accounting information"
        if [ -f /var/account/pacct ]; then
	    Display --indent 2 --text "- Checking accounting information... " --result OK --color GREEN
            logtext "Result: /var/account/pacct available"
          else
	    Display --indent 2 --text "- Checking accounting information... " --result "NOT FOUND" --color YELLOW
            logtext "Result: No accounting information available (/var/account/pacct does not exist)"
            logtext "Remark: Possibly there is another location where the accounting data is stored"
        fi
    fi
#
#################################################################################
#

wait_for_keypress

#
#================================================================================
# Lynis - Copyright 2007-2008, Michael Boelen - www.rootkit.nl - The Netherlands
