in reply to Re: Parsing and verifying login for a CGI form
in thread Parsing and verifying login for a CGI form

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.
  • Comment on Re: Re: Parsing and verifying login for a CGI form

Replies are listed 'Best First'.
Re: Re: Re: problem of a beginner
by antirice (Priest) on Jul 09, 2003 at 09:49 UTC

    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