in reply to getpwnam() password

Probably the easiest thing to do would be to open the shadow file, find the user and read the encrypted password.
open(SHADOW, "< /etc/shadow") || die "Can't open for read: $!";
while(<SHADOW>) {
    if($_ =~ /^$user:(\w+):.*/) {
            print "$user's encrypted password is $1\n";
    }
}

Replies are listed 'Best First'.
RE: Re: getpwnam() password
by coolmichael (Deacon) on Aug 03, 2000 at 05:42 UTC
    That's how I'd do it, but shouldn't line two be
    while(<SHADOW>) {