--- loncom/lond 2001/08/30 20:02:28 1.51 +++ loncom/lond 2001/10/23 04:38:45 1.53 @@ -16,6 +16,7 @@ # 03/24 Gerd Kortemeyer # 04/02 Scott Harrison # 05/11,05/28,08/30 Gerd Kortemeyer +# 9/30,10/22 Scott Harrison # # based on "Perl Cookbook" ISBN 1-56592-243-3 # preforker - server who forks first @@ -471,8 +472,18 @@ sub make_new_child { (crypt($upass,$contentpwd) eq $contentpwd); } elsif ($howpwd eq 'unix') { $contentpwd=(getpwnam($uname))[1]; - $pwdcorrect= - (crypt($upass,$contentpwd) eq $contentpwd); + my $pwauth_path="/usr/local/sbin/pwauth"; + unless ($contentpwd eq 'x') { + $pwdcorrect= + (crypt($upass,$contentpwd) eq $contentpwd); + } + elsif (-e $pwauth_path) { + open PWAUTH, "|$pwauth_path" or + die "Cannot invoke authentication"; + print PWAUTH "$uname\n$upass\n"; + close PWAUTH; + $pwdcorrect=!$?; + } } elsif ($howpwd eq 'krb4') { $pwdcorrect=( Authen::Krb4::get_pw_in_tkt($uname,"", @@ -576,7 +587,18 @@ sub make_new_child { print $pf "localauth:$npass\n"; } print $client "ok\n"; - } elsif ($umode eq 'none') { + } elsif ($umode eq 'unix') { + { + my $execpath="$perlvar{'lonDaemons'}/". + "lcuseradd"; + my $se = IO::File->new("|$execpath"); + print $se "$uname\n"; + print $se "$npass\n"; + print $se "$npass\n"; + my $pf = IO::File->new(">$passfilename"); + print $pf "unix:\n"; + } + } elsif ($umode eq 'none') { { my $pf = IO::File->new(">$passfilename"); print $pf "none:\n";