#
# /etc/gshadow support
#
# Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>

$have_gshadow = 0;

sub gshadow_read {
	local($_, $group);

	return if ($have_gshadow);
	open(PASSWD, "<$source{gshadow}") ||
		&fatal("can't open $source{gshadow}: $!");
	while (<PASSWD>) {
		next if (/^[-+]/o);
		chop;
		($group) = split(/:/);
		print "\$group2gshadow{$group} = $_\n";
		$group2gshadow{$group} = $_;
	}
	close PASSWD;
	$have_gshadow = 1;
}

sub gshadow_byname {

	&gshadow_read;

	foreach $group (keys %group2gshadow) {
		printf OUT "$group\t$group2gshadow{$group}\n";
	}
}

1;
