in reply to Parsing and verifying login for a CGI form

Hello again. Once again, nice to see the progress since your last post. Take a look at this post for some helpful hints.

You have to use ypcat? Why not just use getpwnam, extract the password hash and use crypt with the password hash as the salt? If the return from crypt is the same as the hash, then the password is correct for that account.

antirice    
The first rule of Perl club is - use Perl
The
ith rule of Perl club is - follow rule i - 1 for i > 1

  • Comment on Re: Parsing and verifying login for a CGI form

Replies are listed 'Best First'.
Re: Re: Parsing and verifying login for a CGI form
by Anonymous Monk on Jul 09, 2003 at 09:42 UTC
    HIIIIIII,,and thanx for helping me..but their appears to be some confusion in the case of this linux account checking.i can't use getpwnam as it checks for the password where in all that i require is that the user name entered in the login form must b there in the linux account.so i don't have to check password rather just the name. thank u.please guide me to overcome the error of "not enough arguements"..ypcat passwd |grep name works well in genral unix enviornment.

      getpwnam returns undef if the account doesn't exist. Try this:

      my $username = SomeSubToGetUsername; my $check = getpwnam($username); if ($check) { # account exists ... } else { # account does not exist ... }

      Hope this helps.

      antirice    
      The first rule of Perl club is - use Perl
      The
      ith rule of Perl club is - follow rule i - 1 for i > 1