version 1.489.2.18, 2015/06/14 00:46:35
|
version 1.518, 2016/02/17 19:15:44
|
Line 55 use LONCAPA::lonssl;
|
Line 55 use LONCAPA::lonssl;
|
use Fcntl qw(:flock); |
use Fcntl qw(:flock); |
use Apache::lonnet; |
use Apache::lonnet; |
use Mail::Send; |
use Mail::Send; |
|
use Crypt::Eksblowfish::Bcrypt; |
|
use Digest::SHA; |
|
use Encode; |
|
|
my $DEBUG = 0; # Non zero to enable debug log entries. |
my $DEBUG = 0; # Non zero to enable debug log entries. |
|
|
Line 1932 sub authenticate_handler {
|
Line 1935 sub authenticate_handler {
|
if (ref($hostedsession) eq 'HASH') { |
if (ref($hostedsession) eq 'HASH') { |
$hosted = $hostedsession->{'hosted'}; |
$hosted = $hostedsession->{'hosted'}; |
} |
} |
my $loncaparev = $clientversion; |
|
if ($loncaparev eq '') { |
|
$loncaparev = $Apache::lonnet::loncaparevs{$clientname}; |
|
} |
|
$canhost = &Apache::lonnet::can_host_session($udom,$clientname, |
$canhost = &Apache::lonnet::can_host_session($udom,$clientname, |
$loncaparev, |
$clientversion, |
$remote,$hosted); |
$remote,$hosted); |
} |
} |
} |
} |
Line 2017 sub change_password_handler {
|
Line 2016 sub change_password_handler {
|
my ($howpwd,$contentpwd)=split(/:/,$realpasswd); |
my ($howpwd,$contentpwd)=split(/:/,$realpasswd); |
if ($howpwd eq 'internal') { |
if ($howpwd eq 'internal') { |
&Debug("internal auth"); |
&Debug("internal auth"); |
my $salt=time; |
my $ncpass = &hash_passwd($udom,$npass); |
$salt=substr($salt,6,2); |
|
my $ncpass=crypt($npass,$salt); |
|
if(&rewrite_password_file($udom, $uname, "internal:$ncpass")) { |
if(&rewrite_password_file($udom, $uname, "internal:$ncpass")) { |
my $msg="Result of password change for $uname: pwchange_success"; |
my $msg="Result of password change for $uname: pwchange_success"; |
if ($lonhost) { |
if ($lonhost) { |
$msg .= " - request originated from: $lonhost"; |
$msg .= " - request originated from: $lonhost"; |
} |
} |
&logthis($msg); |
&logthis($msg); |
|
&update_passwd_history($uname,$udom,$howpwd,$context); |
&Reply($client, "ok\n", $userinput); |
&Reply($client, "ok\n", $userinput); |
} else { |
} else { |
&logthis("Unable to open $uname passwd " |
&logthis("Unable to open $uname passwd " |
Line 2034 sub change_password_handler {
|
Line 2032 sub change_password_handler {
|
} |
} |
} elsif ($howpwd eq 'unix' && $context ne 'reset_by_email') { |
} elsif ($howpwd eq 'unix' && $context ne 'reset_by_email') { |
my $result = &change_unix_password($uname, $npass); |
my $result = &change_unix_password($uname, $npass); |
|
if ($result eq 'ok') { |
|
&update_passwd_history($uname,$udom,$howpwd,$context); |
|
} |
&logthis("Result of password change for $uname: ". |
&logthis("Result of password change for $uname: ". |
$result); |
$result); |
&Reply($client, \$result, $userinput); |
&Reply($client, \$result, $userinput); |
Line 2056 sub change_password_handler {
|
Line 2057 sub change_password_handler {
|
} |
} |
®ister_handler("passwd", \&change_password_handler, 1, 1, 0); |
®ister_handler("passwd", \&change_password_handler, 1, 1, 0); |
|
|
|
sub hash_passwd { |
|
my ($domain,$plainpass,@rest) = @_; |
|
my ($salt,$cost); |
|
if (@rest) { |
|
$cost = $rest[0]; |
|
# salt is first 22 characters, base-64 encoded by bcrypt |
|
my $plainsalt = substr($rest[1],0,22); |
|
$salt = Crypt::Eksblowfish::Bcrypt::de_base64($plainsalt); |
|
} else { |
|
my $defaultcost; |
|
my %domconfig = |
|
&Apache::lonnet::get_dom('configuration',['password'],$domain); |
|
if (ref($domconfig{'password'}) eq 'HASH') { |
|
$defaultcost = $domconfig{'password'}{'cost'}; |
|
} |
|
if (($defaultcost eq '') || ($defaultcost =~ /D/)) { |
|
$cost = 10; |
|
} else { |
|
$cost = $defaultcost; |
|
} |
|
# Generate random 16-octet base64 salt |
|
$salt = ""; |
|
$salt .= pack("C", int rand(256)) for 1..16; |
|
} |
|
my $hash = &Crypt::Eksblowfish::Bcrypt::bcrypt_hash({ |
|
key_nul => 1, |
|
cost => $cost, |
|
salt => $salt, |
|
}, Digest::SHA::sha512(Encode::encode('UTF-8',$plainpass))); |
|
|
|
my $result = join("!", "", "bcrypt", sprintf("%02d",$cost), |
|
&Crypt::Eksblowfish::Bcrypt::en_base64($salt). |
|
&Crypt::Eksblowfish::Bcrypt::en_base64($hash)); |
|
return $result; |
|
} |
|
|
# |
# |
# Create a new user. User in this case means a lon-capa user. |
# Create a new user. User in this case means a lon-capa user. |
# The user must either already exist in some authentication realm |
# The user must either already exist in some authentication realm |
Line 2099 sub add_user_handler {
|
Line 2136 sub add_user_handler {
|
."makeuser"; |
."makeuser"; |
} |
} |
unless ($fperror) { |
unless ($fperror) { |
my $result=&make_passwd_file($uname,$udom,$umode,$npass, $passfilename); |
my $result=&make_passwd_file($uname,$udom,$umode,$npass, |
|
$passfilename,'makeuser'); |
&Reply($client,\$result, $userinput); #BUGBUG - could be fail |
&Reply($client,\$result, $userinput); #BUGBUG - could be fail |
} else { |
} else { |
&Failure($client, \$fperror, $userinput); |
&Failure($client, \$fperror, $userinput); |
Line 2168 sub change_authentication_handler {
|
Line 2206 sub change_authentication_handler {
|
my $result = &change_unix_password($uname, $npass); |
my $result = &change_unix_password($uname, $npass); |
&logthis("Result of password change for $uname: ".$result); |
&logthis("Result of password change for $uname: ".$result); |
if ($result eq "ok") { |
if ($result eq "ok") { |
|
&update_passwd_history($uname,$udom,$umode,'changeuserauth'); |
&Reply($client, \$result); |
&Reply($client, \$result); |
} else { |
} else { |
&Failure($client, \$result); |
&Failure($client, \$result); |
} |
} |
} else { |
} else { |
my $result=&make_passwd_file($uname,$udom,$umode,$npass,$passfilename); |
my $result=&make_passwd_file($uname,$udom,$umode,$npass, |
|
$passfilename,'changeuserauth'); |
# |
# |
# If the current auth mode is internal, and the old auth mode was |
# If the current auth mode is internal, and the old auth mode was |
# unix, or krb*, and the user is an author for this domain, |
# unix, or krb*, and the user is an author for this domain, |
Line 2194 sub change_authentication_handler {
|
Line 2234 sub change_authentication_handler {
|
} |
} |
®ister_handler("changeuserauth", \&change_authentication_handler, 1,1, 0); |
®ister_handler("changeuserauth", \&change_authentication_handler, 1,1, 0); |
|
|
|
sub update_passwd_history { |
|
my ($uname,$udom,$umode,$context) = @_; |
|
my $proname=&propath($udom,$uname); |
|
my $now = time; |
|
if (open(my $fh,">>$proname/passwd.log")) { |
|
print $fh "$now:$umode:$context\n"; |
|
close($fh); |
|
} |
|
return; |
|
} |
|
|
# |
# |
# Determines if this is the home server for a user. The home server |
# Determines if this is the home server for a user. The home server |
# for a user will have his/her lon-capa passwd file. Therefore all we need |
# for a user will have his/her lon-capa passwd file. Therefore all we need |
Line 2816 sub newput_user_profile_entry {
|
Line 2867 sub newput_user_profile_entry {
|
&logthis("error: ".($!+0)." untie (GDBM) failed ". |
&logthis("error: ".($!+0)." untie (GDBM) failed ". |
"while attempting newput - early out as key exists"); |
"while attempting newput - early out as key exists"); |
} |
} |
&Failure($client, "key_exists: ".$key."\n",$userinput); |
&Failure($client, "key_exists: ".$key."\n",$userinput); |
return 1; |
return 1; |
} |
} |
} |
} |
|
|
Line 3219 sub get_profile_keys {
|
Line 3270 sub get_profile_keys {
|
sub dump_profile_database { |
sub dump_profile_database { |
my ($cmd, $tail, $client) = @_; |
my ($cmd, $tail, $client) = @_; |
|
|
|
my $res = LONCAPA::Lond::dump_profile_database($tail); |
|
|
|
if ($res =~ /^error:/) { |
|
Failure($client, \$res, "$cmd:$tail"); |
|
} else { |
|
Reply($client, \$res, "$cmd:$tail"); |
|
} |
|
|
|
return 1; |
|
|
|
#TODO remove |
my $userinput = "$cmd:$tail"; |
my $userinput = "$cmd:$tail"; |
|
|
my ($udom,$uname,$namespace) = split(/:/,$tail); |
my ($udom,$uname,$namespace) = split(/:/,$tail); |
Line 3298 sub dump_with_regexp {
|
Line 3360 sub dump_with_regexp {
|
my ($cmd, $tail, $client) = @_; |
my ($cmd, $tail, $client) = @_; |
|
|
my $res = LONCAPA::Lond::dump_with_regexp($tail, $clientversion); |
my $res = LONCAPA::Lond::dump_with_regexp($tail, $clientversion); |
|
|
if ($res =~ /^error:/) { |
if ($res =~ /^error:/) { |
&Failure($client, \$res, "$cmd:$tail"); |
Failure($client, \$res, "$cmd:$tail"); |
} else { |
} else { |
&Reply($client, \$res, "$cmd:$tail"); |
Reply($client, \$res, "$cmd:$tail"); |
} |
} |
|
|
return 1; |
return 1; |
Line 3340 sub store_handler {
|
Line 3402 sub store_handler {
|
my ($cmd, $tail, $client) = @_; |
my ($cmd, $tail, $client) = @_; |
|
|
my $userinput = "$cmd:$tail"; |
my $userinput = "$cmd:$tail"; |
|
|
chomp($tail); |
chomp($tail); |
my ($udom,$uname,$namespace,$rid,$what,$laststore) =split(/:/,$tail); |
my ($udom,$uname,$namespace,$rid,$what,$laststore) =split(/:/,$tail); |
if ($namespace ne 'roles') { |
if ($namespace ne 'roles') { |
Line 3370 sub store_handler {
|
Line 3431 sub store_handler {
|
$numtrans =~ s/D//g; |
$numtrans =~ s/D//g; |
} |
} |
} |
} |
|
|
$hashref->{"version:$rid"}++; |
$hashref->{"version:$rid"}++; |
my $version=$hashref->{"version:$rid"}; |
my $version=$hashref->{"version:$rid"}; |
my $allkeys=''; |
my $allkeys=''; |
Line 3387 sub store_handler {
|
Line 3447 sub store_handler {
|
if ($numtrans) { |
if ($numtrans) { |
$msg = 'delay:'.$numtrans; |
$msg = 'delay:'.$numtrans; |
} |
} |
&Reply($client, "$msg\n", $userinput); |
&Reply($client, "$msg\n", $userinput); |
} else { |
} else { |
&Failure($client, "error: ".($!+0)." untie(GDBM) Failed ". |
&Failure($client, "error: ".($!+0)." untie(GDBM) Failed ". |
"while attempting store\n", $userinput); |
"while attempting store\n", $userinput); |
Line 3904 sub put_course_id_hash_handler {
|
Line 3964 sub put_course_id_hash_handler {
|
# |
# |
# domcloner - flag to indicate if user can create CCs in course's domain. |
# domcloner - flag to indicate if user can create CCs in course's domain. |
# If so, ability to clone course is automatic. |
# If so, ability to clone course is automatic. |
# hasuniquecode - filter by courses for which a six character unique code has |
# hasuniquecode - filter by courses for which a six character unique code has |
# been set. |
# been set. |
# |
# |
# $client - The socket open on the client. |
# $client - The socket open on the client. |
Line 3914 sub put_course_id_hash_handler {
|
Line 3974 sub put_course_id_hash_handler {
|
# a reply is written to $client. |
# a reply is written to $client. |
sub dump_course_id_handler { |
sub dump_course_id_handler { |
my ($cmd, $tail, $client) = @_; |
my ($cmd, $tail, $client) = @_; |
|
|
|
my $res = LONCAPA::Lond::dump_course_id_handler($tail); |
|
if ($res =~ /^error:/) { |
|
Failure($client, \$res, "$cmd:$tail"); |
|
} else { |
|
Reply($client, \$res, "$cmd:$tail"); |
|
} |
|
|
|
return 1; |
|
|
|
#TODO remove |
my $userinput = "$cmd:$tail"; |
my $userinput = "$cmd:$tail"; |
|
|
my ($udom,$since,$description,$instcodefilter,$ownerfilter,$coursefilter, |
my ($udom,$since,$description,$instcodefilter,$ownerfilter,$coursefilter, |
Line 4361 sub put_domain_handler {
|
Line 4432 sub put_domain_handler {
|
} |
} |
®ister_handler("putdom", \&put_domain_handler, 0, 1, 0); |
®ister_handler("putdom", \&put_domain_handler, 0, 1, 0); |
|
|
|
# Updates one or more entries in clickers.db file at the domain level |
|
# |
|
# Parameters: |
|
# $cmd - The command that got us here. |
|
# $tail - Tail of the command (remaining parameters). |
|
# In this case a colon separated list containing: |
|
# (a) the domain for which we are updating the entries, |
|
# (b) the action required -- add or del -- and |
|
# (c) a &-separated list of entries to add or delete. |
|
# $client - File descriptor connected to client. |
|
# Returns |
|
# 1 - Continue processing. |
|
# 0 - Requested to exit, caller should shut down. |
|
# Side effects: |
|
# reply is written to $client. |
|
# |
|
|
|
|
|
sub update_clickers { |
|
my ($cmd, $tail, $client) = @_; |
|
|
|
my $userinput = "$cmd:$tail"; |
|
my ($udom,$action,$what) =split(/:/,$tail,3); |
|
chomp($what); |
|
|
|
my $hashref = &tie_domain_hash($udom, "clickers", &GDBM_WRCREAT(), |
|
"U","$action:$what"); |
|
|
|
if (!$hashref) { |
|
&Failure( $client, "error: ".($!+0)." tie(GDBM) Failed ". |
|
"while attempting updateclickers\n", $userinput); |
|
return 1; |
|
} |
|
|
|
my @pairs=split(/\&/,$what); |
|
foreach my $pair (@pairs) { |
|
my ($key,$value)=split(/=/,$pair); |
|
if ($action eq 'add') { |
|
if (exists($hashref->{$key})) { |
|
my @newvals = split(/,/,&unescape($value)); |
|
my @currvals = split(/,/,&unescape($hashref->{$key})); |
|
my @merged = sort(keys(%{{map { $_ => 1 } (@newvals,@currvals)}})); |
|
$hashref->{$key}=&escape(join(',',@merged)); |
|
} else { |
|
$hashref->{$key}=$value; |
|
} |
|
} elsif ($action eq 'del') { |
|
if (exists($hashref->{$key})) { |
|
my %current; |
|
map { $current{$_} = 1; } split(/,/,&unescape($hashref->{$key})); |
|
map { delete($current{$_}); } split(/,/,&unescape($value)); |
|
if (keys(%current)) { |
|
$hashref->{$key}=&escape(join(',',sort(keys(%current)))); |
|
} else { |
|
delete($hashref->{$key}); |
|
} |
|
} |
|
} |
|
} |
|
if (&untie_user_hash($hashref)) { |
|
&Reply( $client, "ok\n", $userinput); |
|
} else { |
|
&Failure($client, "error: ".($!+0)." untie(GDBM) failed ". |
|
"while attempting put\n", |
|
$userinput); |
|
} |
|
return 1; |
|
} |
|
®ister_handler("updateclickers", \&update_clickers, 0, 1, 0); |
|
|
|
|
|
# Deletes one or more entries in a namespace db file at the domain level |
|
# |
|
# Parameters: |
|
# $cmd - The command that got us here. |
|
# $tail - Tail of the command (remaining parameters). |
|
# In this case a colon separated list containing: |
|
# (a) the domain for which we are deleting the entries, |
|
# (b) &-separated list of keys to delete. |
|
# $client - File descriptor connected to client. |
|
# Returns |
|
# 1 - Continue processing. |
|
# 0 - Requested to exit, caller should shut down. |
|
# Side effects: |
|
# reply is written to $client. |
|
# |
|
|
|
sub del_domain_handler { |
|
my ($cmd,$tail,$client) = @_; |
|
|
|
my $userinput = "$cmd:$tail"; |
|
|
|
my ($udom,$namespace,$what)=split(/:/,$tail,3); |
|
chomp($what); |
|
my $hashref = &tie_domain_hash($udom,$namespace,&GDBM_WRCREAT(), |
|
"D", $what); |
|
if ($hashref) { |
|
my @keys=split(/\&/,$what); |
|
foreach my $key (@keys) { |
|
delete($hashref->{$key}); |
|
} |
|
if (&untie_user_hash($hashref)) { |
|
&Reply($client, "ok\n", $userinput); |
|
} else { |
|
&Failure($client, "error: ".($!+0)." untie(GDBM) Failed ". |
|
"while attempting deldom\n", $userinput); |
|
} |
|
} else { |
|
&Failure( $client, "error: ".($!+0)." tie(GDBM) Failed ". |
|
"while attempting deldom\n", $userinput); |
|
} |
|
return 1; |
|
} |
|
®ister_handler("deldom", \&del_domain_handler, 0, 1, 0); |
|
|
|
|
# Unencrypted get from the namespace database file at the domain level. |
# Unencrypted get from the namespace database file at the domain level. |
# This function retrieves a keyed item from a specific named database in the |
# This function retrieves a keyed item from a specific named database in the |
# domain directory. |
# domain directory. |
Line 4520 sub get_id_handler {
|
Line 4707 sub get_id_handler {
|
# Returns: |
# Returns: |
# 1 - Continue processing |
# 1 - Continue processing |
# 0 - Exit server. |
# 0 - Exit server. |
# |
# |
# |
# |
|
|
sub del_id_handler { |
sub del_id_handler { |
Line 6363 sub Debug {
|
Line 6550 sub Debug {
|
# reply - Text to send to client. |
# reply - Text to send to client. |
# request - Original request from client. |
# request - Original request from client. |
# |
# |
|
#NOTE $reply must be terminated by exactly *one* \n. If $reply is a reference |
|
#this is done automatically ($$reply must not contain any \n in this case). |
|
#If $reply is a string the caller has to ensure this. |
sub Reply { |
sub Reply { |
my ($fd, $reply, $request) = @_; |
my ($fd, $reply, $request) = @_; |
if (ref($reply)) { |
if (ref($reply)) { |
Line 6616 sub make_new_child {
|
Line 6806 sub make_new_child {
|
} |
} |
} elsif ($dist =~ /^suse(\d+\.\d+)$/) { |
} elsif ($dist =~ /^suse(\d+\.\d+)$/) { |
if (($1 eq '9.3') || ($1 >= 12.2)) { |
if (($1 eq '9.3') || ($1 >= 12.2)) { |
$no_ets = 1; |
$no_ets = 1; |
} |
} |
} elsif ($dist =~ /^sles(\d+)$/) { |
} elsif ($dist =~ /^sles(\d+)$/) { |
if ($1 > 11) { |
if ($1 > 11) { |
Line 6628 sub make_new_child {
|
Line 6818 sub make_new_child {
|
} |
} |
} |
} |
unless ($no_ets) { |
unless ($no_ets) { |
&Authen::Krb5::init_ets(); |
&Authen::Krb5::init_ets(); |
} |
} |
|
|
&status('Accepted connection'); |
&status('Accepted connection'); |
# ============================================================================= |
# ============================================================================= |
Line 6673 sub make_new_child {
|
Line 6863 sub make_new_child {
|
# If the remote is attempting a local init... give that a try: |
# If the remote is attempting a local init... give that a try: |
# |
# |
(my $i, my $inittype, $clientversion) = split(/:/, $remotereq); |
(my $i, my $inittype, $clientversion) = split(/:/, $remotereq); |
# For LON-CAPA 2.9, the client session will have sent its LON-CAPA |
# For LON-CAPA 2.9, the client session will have sent its LON-CAPA |
# version when initiating the connection. For LON-CAPA 2.8 and older, |
# version when initiating the connection. For LON-CAPA 2.8 and older, |
# the version is retrieved from the global %loncaparevs in lonnet.pm. |
# the version is retrieved from the global %loncaparevs in lonnet.pm. |
# $clientversion contains path to keyfile if $inittype eq 'local' |
# $clientversion contains path to keyfile if $inittype eq 'local' |
# it's overridden below in this case |
# it's overridden below in this case |
$clientversion ||= $Apache::lonnet::loncaparevs{$clientname}; |
$clientversion ||= $Apache::lonnet::loncaparevs{$clientname}; |
|
|
# If the connection type is ssl, but I didn't get my |
# If the connection type is ssl, but I didn't get my |
# certificate files yet, then I'll drop back to |
# certificate files yet, then I'll drop back to |
Line 7012 sub validate_user {
|
Line 7202 sub validate_user {
|
} |
} |
if ($howpwd ne 'nouser') { |
if ($howpwd ne 'nouser') { |
if($howpwd eq "internal") { # Encrypted is in local password file. |
if($howpwd eq "internal") { # Encrypted is in local password file. |
$validated = (crypt($password, $contentpwd) eq $contentpwd); |
if (length($contentpwd) == 13) { |
|
$validated = (crypt($password,$contentpwd) eq $contentpwd); |
|
if ($validated) { |
|
my $ncpass = &hash_passwd($domain,$password); |
|
if (&rewrite_password_file($domain,$user,"$howpwd:$ncpass")) { |
|
&update_passwd_history($user,$domain,$howpwd,'conversion'); |
|
&logthis("Validated password hashed with bcrypt for $user:$domain"); |
|
} |
|
} |
|
} else { |
|
$validated = &check_internal_passwd($password,$contentpwd,$domain); |
|
} |
} |
} |
elsif ($howpwd eq "unix") { # User is a normal unix user. |
elsif ($howpwd eq "unix") { # User is a normal unix user. |
$contentpwd = (getpwnam($user))[1]; |
$contentpwd = (getpwnam($user))[1]; |
Line 7080 sub validate_user {
|
Line 7281 sub validate_user {
|
return $validated; |
return $validated; |
} |
} |
|
|
|
sub check_internal_passwd { |
|
my ($plainpass,$stored,$domain) = @_; |
|
my (undef,$method,@rest) = split(/!/,$stored); |
|
if ($method eq "bcrypt") { |
|
my $result = &hash_passwd($domain,$plainpass,@rest); |
|
if ($result ne $stored) { |
|
return 0; |
|
} |
|
# Upgrade to a larger number of rounds if necessary |
|
my $defaultcost; |
|
my %domconfig = |
|
&Apache::lonnet::get_dom('configuration',['password'],$domain); |
|
if (ref($domconfig{'password'}) eq 'HASH') { |
|
$defaultcost = $domconfig{'password'}{'cost'}; |
|
} |
|
if (($defaultcost eq '') || ($defaultcost =~ /D/)) { |
|
$defaultcost = 10; |
|
} |
|
return 1 unless($rest[0]<$defaultcost); |
|
} |
|
return 0; |
|
} |
|
|
|
sub get_last_authchg { |
|
my ($domain,$user) = @_; |
|
my $lastmod; |
|
my $logname = &propath($domain,$user).'/passwd.log'; |
|
if (-e "$logname") { |
|
$lastmod = (stat("$logname"))[9]; |
|
} |
|
return $lastmod; |
|
} |
|
|
sub krb4_authen { |
sub krb4_authen { |
my ($password,$null,$user,$contentpwd) = @_; |
my ($password,$null,$user,$contentpwd) = @_; |
my $validated = 0; |
my $validated = 0; |
Line 7395 sub change_unix_password {
|
Line 7629 sub change_unix_password {
|
|
|
|
|
sub make_passwd_file { |
sub make_passwd_file { |
my ($uname,$udom,$umode,$npass,$passfilename)=@_; |
my ($uname,$udom,$umode,$npass,$passfilename,$action)=@_; |
my $result="ok"; |
my $result="ok"; |
if ($umode eq 'krb4' or $umode eq 'krb5') { |
if ($umode eq 'krb4' or $umode eq 'krb5') { |
{ |
{ |
my $pf = IO::File->new(">$passfilename"); |
my $pf = IO::File->new(">$passfilename"); |
if ($pf) { |
if ($pf) { |
print $pf "$umode:$npass\n"; |
print $pf "$umode:$npass\n"; |
|
&update_passwd_history($uname,$udom,$umode,$action); |
} else { |
} else { |
$result = "pass_file_failed_error"; |
$result = "pass_file_failed_error"; |
} |
} |
} |
} |
} elsif ($umode eq 'internal') { |
} elsif ($umode eq 'internal') { |
my $salt=time; |
my $ncpass = &hash_passwd($udom,$npass); |
$salt=substr($salt,6,2); |
|
my $ncpass=crypt($npass,$salt); |
|
{ |
{ |
&Debug("Creating internal auth"); |
&Debug("Creating internal auth"); |
my $pf = IO::File->new(">$passfilename"); |
my $pf = IO::File->new(">$passfilename"); |
if($pf) { |
if($pf) { |
print $pf "internal:$ncpass\n"; |
print $pf "internal:$ncpass\n"; |
|
&update_passwd_history($uname,$udom,$umode,$action); |
} else { |
} else { |
$result = "pass_file_failed_error"; |
$result = "pass_file_failed_error"; |
} |
} |
Line 7495 sub get_usersession_config {
|
Line 7729 sub get_usersession_config {
|
} |
} |
|
|
|
|
|
|
|
|
sub distro_and_arch { |
sub distro_and_arch { |
return $dist.':'.$arch; |
return $dist.':'.$arch; |
} |
} |
Line 7678 Allow for a password to be set.
|
Line 7914 Allow for a password to be set.
|
|
|
Make a user. |
Make a user. |
|
|
=item passwd |
=item changeuserauth |
|
|
Allow for authentication mechanism and password to be changed. |
Allow for authentication mechanism and password to be changed. |
|
|
Line 7767 for each student, defined perhaps by the
|
Line 8003 for each student, defined perhaps by the
|
Returns usernames corresponding to IDs. (These "IDs" are unique identifiers |
Returns usernames corresponding to IDs. (These "IDs" are unique identifiers |
for each student, defined perhaps by the institutional Registrar.) |
for each student, defined perhaps by the institutional Registrar.) |
|
|
|
=item iddel |
|
|
|
Deletes one or more ids in a domain's id database. |
|
|
=item tmpput |
=item tmpput |
|
|
Accept and store information in temporary space. |
Accept and store information in temporary space. |
Line 7823 Authen::Krb5
|
Line 8063 Authen::Krb5
|
|
|
=head1 COREQUISITES |
=head1 COREQUISITES |
|
|
|
none |
|
|
=head1 OSNAMES |
=head1 OSNAMES |
|
|
linux |
linux |
Line 7910 or the CA's certificate in the call to l
|
Line 8152 or the CA's certificate in the call to l
|
<error> is the textual reason this failed. Usual reasons: |
<error> is the textual reason this failed. Usual reasons: |
|
|
=over 2 |
=over 2 |
|
|
=item Apache config file for loncapa incorrect: |
=item Apache config file for loncapa incorrect: |
|
|
one of the variables |
one of the variables |
lonCertificateDirectory, lonnetCertificateAuthority, or lonnetCertificate |
lonCertificateDirectory, lonnetCertificateAuthority, or lonnetCertificate |
undefined or incorrect |
undefined or incorrect |
Line 8031 Could not rewrite the
|
Line 8273 Could not rewrite the
|
internal password file for a user |
internal password file for a user |
|
|
=item Result of password change for <user> : <result> |
=item Result of password change for <user> : <result> |
|
|
A unix password change for <user> was attempted |
A unix password change for <user> was attempted |
and the pipe returned <result> |
and the pipe returned <result> |
|
|
Line 8060 lond has been asked to exit by its clien
|
Line 8302 lond has been asked to exit by its clien
|
client systemand <input> is the full exit command sent to the server. |
client systemand <input> is the full exit command sent to the server. |
|
|
=item Red CRITICAL: ABNORMAL EXIT. child <pid> for server <hostname> died through a crass with this error->[<message>]. |
=item Red CRITICAL: ABNORMAL EXIT. child <pid> for server <hostname> died through a crass with this error->[<message>]. |
|
|
A lond child terminated. NOte that this termination can also occur when the |
A lond child terminated. NOte that this termination can also occur when the |
child receives the QUIT or DIE signals. <pid> is the process id of the child, |
child receives the QUIT or DIE signals. <pid> is the process id of the child, |
<hostname> the host lond is working for, and <message> the reason the child died |
<hostname> the host lond is working for, and <message> the reason the child died |
Line 8144 file when sent it's USR1 signal. That p
|
Line 8386 file when sent it's USR1 signal. That p
|
assumed to be hung in some un-fixable way. |
assumed to be hung in some un-fixable way. |
|
|
=item Finished checking children |
=item Finished checking children |
|
|
Master processs's USR1 processing is cojmplete. |
Master processs's USR1 processing is cojmplete. |
|
|
=item (Red) CRITICAL: ------- Starting ------ |
=item (Red) CRITICAL: ------- Starting ------ |
Line 8158 Started a new child process for <client>
|
Line 8400 Started a new child process for <client>
|
connected to the child. This was as a result of a TCP/IP connection from a client. |
connected to the child. This was as a result of a TCP/IP connection from a client. |
|
|
=item Unable to determine who caller was, getpeername returned nothing |
=item Unable to determine who caller was, getpeername returned nothing |
|
|
In child process initialization. either getpeername returned undef or |
In child process initialization. either getpeername returned undef or |
a zero sized object was returned. Processing continues, but in my opinion, |
a zero sized object was returned. Processing continues, but in my opinion, |
this should be cause for the child to exit. |
this should be cause for the child to exit. |
Line 8169 In child process initialization. The pe
|
Line 8411 In child process initialization. The pe
|
The client address is stored as "Unavailable" and processing continues. |
The client address is stored as "Unavailable" and processing continues. |
|
|
=item (Yellow) INFO: Connection <ip> <name> connection type = <type> |
=item (Yellow) INFO: Connection <ip> <name> connection type = <type> |
|
|
In child initialization. A good connectionw as received from <ip>. |
In child initialization. A good connectionw as received from <ip>. |
|
|
=over 2 |
=over 2 |
Line 8219 The client (<client> is the peer's name
|
Line 8461 The client (<client> is the peer's name
|
negotiated an SSL connection with this child process. |
negotiated an SSL connection with this child process. |
|
|
=item (Green) Successful insecure authentication with <client> |
=item (Green) Successful insecure authentication with <client> |
|
|
|
|
The client has successfully negotiated an insecure connection withthe child process. |
The client has successfully negotiated an insecure connection withthe child process. |
|
|