sub check_passwd {
my ($uname,$guess) = @_;
my ($name, $passwd, $uid) = getpwnam($uname);
$supervisor = $uname;
return (crypt($guess, $passwd) eq $passwd);
}
sub check_group {
my ($uname,$group) = @_;
while(($name, undef, undef, $members) = getgrent) {
next if $name ne $group;
return (grep { $_ eq $uname } split ( / /,$members )) ;
}
}
####
User::grent
####
User::pwent
####
sub check_passwd_nt {
my ($uname,$guess) = @_;
my $pw = getpw($uname);
print Dumper($pw);
}
sub check_group_nt {
my ($uname,$group) = @_;
my $gr = getgr($uname);
print Dumper($gr);
}
&check_passwd_nt($user_text,$passwd_text);
&check_group_nt($user_text,"supercam");