home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-385-Vol-1of3.iso
/
c
/
cops_104.zip
/
cops_104
/
docs
/
readme.C2
/
group.chk
next >
Wrap
Text File
|
1992-03-10
|
2KB
|
85 lines
#!/bin/sh
#
# group.chk
#
# Check group file -- /etc/group -- for incorrect number of fields,
# duplicate groups, non-alphanumeric group names, and non-numeric group
# id's.
#
ECHO=/bin/echo
RM=/bin/rm
TEST=/bin/test
YPCAT=/usr/bin/ypcat
#
# Enhanced Security Features addes by Pete Troxell:
#
# Used for Sun C2 security group file. FALSE (default) will flag
# valid C2 group syntax as an error, TRUE attempts to validate it. When
# using this option the script must be executed as root or su since the file
# /etc/security/group.adjunct is read protected from everybody except root.
#
SUN_SECURITY=FALSE
#
# Enable/Disable testing of the Yellow Pages group file(s)
#
TEST_YP=FALSE
#
# Important files:
#
etc_group=/etc/group
etc_secure_group=/etc/security/group.adjunct
yp_group=./grp$$
yp_secure_group=./sgrp$$
yp=false
yp_secure=false
#
# Testing $yp_group for potential problems....
#
if $TEST -f $YPCAT -a $TEST_YP = "TRUE"
then
if $TEST -s $YPCAT
then
$YPCAT group > $yp_group 2>/dev/null
if $TEST $? -eq 0
then
yp=true
fi
if $TEST $yp = "true" -a $SUN_SECFURITY = "TRUE"
then
$YPCAT -t group.adjunct.byname > $yp_secure_group 2>/dev/null
if $TEST $? -eq 0
then
yp_secure=true
fi
fi
fi
fi
#
# Test the system group file
#
group.file.chk $etc_group $etc_secure_group $SUN_SECURITY
#
# Test yellow pages password file
#
if $TEST "$yp" = "true"
then
$ECHO
$ECHO "***** Testing the Yellow Pages password file(s) ******"
$ECHO
group.file.chk $yp_group $yp_secure_group $SUN_SECURITY
fi
#
# Clean up after ourselfs
#
$RM -f $yp_group
$RM -f $yp_secure_group
# end