Dear monks,
I am looking for a (moderately) portable way of running system user authentication. I thought I understood from the perldocs that the following would work in an ideal world:
use strict;
use warnings;
my @pwstruct = getpwnam('me');
my $plain = '****';
my $encrypted = $pwstruct[1];
if ( crypt( $plain, $encrypted ) eq $encrypted ) {
print "ok";
}
but it neither does on OSX (10.4, intel) nor on x86 red hat (not sure if these are "ideal world") so I guess I misunderstood. What am I missing?
Thank you!