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

$have_shadow = 0;

sub shadow_read {
	local($_, $user);

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

sub shadow_byname {

	&shadow_read;

	foreach $user (keys %user2shadow) {
		printf OUT "$user\t$user2shadow{$user}\n";
	}
}

1;
