#!/bin/sh
#
#     tiger - A UN*X security checking system
#     Copyright (C) 1993 Douglas Lee Schales, David K. Hess, David R. Safford
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 1, or (at your option)
#    any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#     Please see the file `COPYING' for the complete copyright notice.
#
# SunOS/5/gen_group_sets - 06/14/93
#
#-----------------------------------------------------------------------------
#

INPUTS=`
$GREP '^group' /etc/nsswitch.conf |
$AWK '{
       for(i=2;i<=NF;i++)
          print $i
      }'
`

for source in $INPUTS
do
  case $source in
    files)
         $SORT /etc/group > $WORKDIR/etc_group.$$
	 echo "/etc/group" > $WORKDIR/etc_group.$$.src
	 echo $WORKDIR/etc_group.$$
	 ;;
    nis)
	   $YPCAT group > $WORKDIR/nis_gruop.$$
	   echo "NIS" > $WORKDIR/nis_group.$$.src
	   echo $WORKDIR/nis_group.$$
	 ;;
    nisplus)
           $NISCAT group.org_dir > $WORKDIR/nisplus_group.$$
	   echo "NIS+" > $WORKDIR/nisplus_group.$$.src
	   echo "$WORKDIR/nisplus_group.$$"
         ;;
    *)
         ;;
  esac
done
