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 >
Text File  |  1992-03-10  |  2KB  |  85 lines

  1. #!/bin/sh
  2. #
  3. #   group.chk
  4. #
  5. #  Check group file -- /etc/group -- for incorrect number of fields,
  6. # duplicate groups, non-alphanumeric group names, and non-numeric group
  7. # id's.
  8. #
  9. ECHO=/bin/echo
  10. RM=/bin/rm
  11. TEST=/bin/test
  12. YPCAT=/usr/bin/ypcat
  13.  
  14. #
  15. # Enhanced Security Features addes by Pete Troxell:
  16. #
  17. #   Used for Sun C2 security group file.  FALSE (default) will flag
  18. # valid C2 group syntax as an error, TRUE attempts to validate it. When
  19. # using this option the script must be executed as root or su since the file
  20. # /etc/security/group.adjunct is read protected from everybody except root.
  21. #
  22. SUN_SECURITY=FALSE
  23.  
  24. #
  25. # Enable/Disable testing of the Yellow Pages group file(s)
  26. #
  27. TEST_YP=FALSE
  28.  
  29. #
  30. # Important files:
  31. #
  32. etc_group=/etc/group
  33. etc_secure_group=/etc/security/group.adjunct
  34. yp_group=./grp$$
  35. yp_secure_group=./sgrp$$
  36.  
  37. yp=false
  38. yp_secure=false
  39.  
  40. #
  41. # Testing $yp_group for potential problems....
  42. #
  43. if $TEST -f $YPCAT -a $TEST_YP = "TRUE"
  44.     then
  45. if $TEST -s $YPCAT
  46.     then
  47.     $YPCAT group > $yp_group 2>/dev/null
  48.     if $TEST $? -eq 0
  49.         then
  50.         yp=true
  51.     fi
  52.     if $TEST $yp = "true" -a $SUN_SECFURITY = "TRUE"
  53.         then
  54.         $YPCAT -t group.adjunct.byname > $yp_secure_group 2>/dev/null
  55.         if $TEST $? -eq 0
  56.             then
  57.             yp_secure=true
  58.         fi
  59.     fi
  60. fi
  61. fi
  62.  
  63. #
  64. # Test the system group file
  65. #
  66. group.file.chk $etc_group $etc_secure_group $SUN_SECURITY
  67.  
  68. #
  69. # Test yellow pages password file
  70. #
  71. if $TEST "$yp" = "true"
  72.     then
  73.     $ECHO
  74.     $ECHO "***** Testing the Yellow Pages password file(s) ******"
  75.     $ECHO
  76.     group.file.chk $yp_group $yp_secure_group $SUN_SECURITY
  77.     fi
  78.  
  79. #
  80. # Clean up after ourselfs
  81. #
  82. $RM -f $yp_group
  83. $RM -f $yp_secure_group
  84. # end
  85.