410.logincheck revision 177606
1161602Strhodes#!/bin/sh - 2161602Strhodes# 3161602Strhodes# Copyright (c) 2006 Tom Rhodes 4161602Strhodes# All rights reserved. 5161602Strhodes# 6161602Strhodes# Redistribution and use in source and binary forms, with or without 7161602Strhodes# modification, are permitted provided that the following conditions 8161602Strhodes# are met: 9161602Strhodes# 1. Redistributions of source code must retain the above copyright 10161602Strhodes# notice, this list of conditions and the following disclaimer. 11161602Strhodes# 2. Redistributions in binary form must reproduce the above copyright 12161602Strhodes# notice, this list of conditions and the following disclaimer in the 13161602Strhodes# documentation and/or other materials provided with the distribution. 14161602Strhodes# 15161602Strhodes# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16161602Strhodes# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17161602Strhodes# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18161602Strhodes# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19161602Strhodes# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20161602Strhodes# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21161602Strhodes# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22161602Strhodes# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23161602Strhodes# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24161602Strhodes# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25161602Strhodes# SUCH DAMAGE. 26161602Strhodes# 27161602Strhodes# $FreeBSD: head/etc/periodic/security/410.logincheck 177606 2008-03-25 15:16:19Z remko $ 28161602Strhodes# 29161602Strhodes 30161602Strhodes# If there is a global system configuration file, suck it in. 31161602Strhodes# 32161602Strhodesif [ -r /etc/defaults/periodic.conf ] 33161602Strhodesthen 34161602Strhodes . /etc/defaults/periodic.conf 35161602Strhodes source_periodic_confs 36161602Strhodesfi 37161602Strhodes 38161602Strhodescase "$daily_status_security_logincheck_enable" in 39161602Strhodes [Yy][Ee][Ss]) 40161602Strhodes echo "" 41161602Strhodes echo 'Checking login.conf permissions:' 42177606Sremko if [ -G /etc/login.conf -a -O /etc/login.conf ]; then 43161602Strhodes n=0 44161602Strhodes else 45161602Strhodes echo "Bad ownership of /etc/login.conf" 46161602Strhodes n=1 47161602Strhodes fi 48161602Strhodes [ $n -gt 0 ] && rc=1 || rc=0;; 49161602Strhodes *) rc=0;; 50161602Strhodesesac 51161602Strhodes 52161602Strhodesexit "$rc" 53