-sub check_login_name {
- #
- # Check to see whether login name is in password file
- local($login_name) = @_;
- local($Mname, $Mpassword, $Muid, $Mgid, $Mclass, $Mchange, $Mexpire,
- $Mgecos, $Mhome_dir, $Mshell);
- local($i);
-
- seek(MASTER_PW, 0, 0);
- while ($i = <MASTER_PW>) {
- chop $i;
- ($Mname, $Mpassword, $Muid, $Mgid, $Mclass, $Mchange, $Mexpire,
- $Mgecos, $Mhome_dir, $Mshell) = split(/:/, $i);
- if ($Mname eq $login_name) {
- seek(MASTER_PW, 0, 0);
- return($i); # User is in password database
- }
- }
- seek(MASTER_PW, 0, 0);
-
- return '0'; # User wasn't found
-}
-