Hello all,

I have been attempting to implement an authentication scheme to run on both HPUX and Win_NT machines.

Until I was forced ( against my will ) to bring the NT systems into our engineering arena I was simply using this for authentication:

sub check_passwd { my ($uname,$guess) = @_; my ($name, $passwd, $uid) = getpwnam($uname); $supervisor = $uname; return (crypt($guess, $passwd) eq $passwd); } sub check_group { my ($uname,$group) = @_; while(($name, undef, undef, $members) = getgrent) { next if $name ne $group; return (grep { $_ eq $uname } split ( / /,$members )) ; } }
This was working great!!

Now with NT I have been reading and searching and have found some info regarding using User::grent and User::pwentThe code I have so far to use these modules looks something like this...

sub check_passwd_nt { my ($uname,$guess) = @_; my $pw = getpw($uname); print Dumper($pw); } sub check_group_nt { my ($uname,$group) = @_; my $gr = getgr($uname); print Dumper($gr); } &check_passwd_nt($user_text,$passwd_text); &check_group_nt($user_text,"supercam");
I have a Tk popup to ask for name and passwd and everything I read says that I can do this on NT but I am getting an error message and have found no examples except for the pod's for these modules.

The error is:
"Error: The getpwnam function is unimplemented at v:/NT/perl/lib/User/pwent.pm line 172."

Can anyone give me some examples of how they would authenticate a user on both NT and UNIX?

I have no qualms testing for OS and calling the appropriate function. So I guess I'm really simply needing a way to auth on NT.

Thanks in advance for all your help!!

Prost,
Moe


In reply to How do I authenticate users on multiple platforms? by el-moe

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.