version 1.440, 2010/05/20 18:09:19
|
version 1.500, 2013/04/11 14:59:29
|
Line 15
|
Line 15
|
# |
# |
# LON-CAPA is distributed in the hope that it will be useful, |
# LON-CAPA is distributed in the hope that it will be useful, |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# GNU General Public License for more details. |
# GNU General Public License for more details. |
# |
# |
Line 33 use strict;
|
Line 34 use strict;
|
use lib '/home/httpd/lib/perl/'; |
use lib '/home/httpd/lib/perl/'; |
use LONCAPA; |
use LONCAPA; |
use LONCAPA::Configuration; |
use LONCAPA::Configuration; |
|
use LONCAPA::Lond; |
|
|
use IO::Socket; |
use IO::Socket; |
use IO::File; |
use IO::File; |
Line 52 use LONCAPA::lonlocal;
|
Line 54 use LONCAPA::lonlocal;
|
use LONCAPA::lonssl; |
use LONCAPA::lonssl; |
use Fcntl qw(:flock); |
use Fcntl qw(:flock); |
use Apache::lonnet; |
use Apache::lonnet; |
|
use Mail::Send; |
|
|
my $DEBUG = 0; # Non zero to enable debug log entries. |
my $DEBUG = 0; # Non zero to enable debug log entries. |
|
|
Line 66 my $currentdomainid;
|
Line 69 my $currentdomainid;
|
my $client; |
my $client; |
my $clientip; # IP address of client. |
my $clientip; # IP address of client. |
my $clientname; # LonCAPA name of client. |
my $clientname; # LonCAPA name of client. |
my $clientversion; # LonCAPA version running on client |
my $clientversion; # LonCAPA version running on client. |
|
my $clienthomedom; # LonCAPA domain of homeID for client. |
|
# primary library server. |
|
|
my $server; |
my $server; |
|
|
Line 88 my %managers; # Ip -> manager names
|
Line 93 my %managers; # Ip -> manager names
|
|
|
my %perlvar; # Will have the apache conf defined perl vars. |
my %perlvar; # Will have the apache conf defined perl vars. |
|
|
|
my $dist; |
|
|
# |
# |
# The hash below is used for command dispatching, and is therefore keyed on the request keyword. |
# The hash below is used for command dispatching, and is therefore keyed on the request keyword. |
# Each element of the hash contains a reference to an array that contains: |
# Each element of the hash contains a reference to an array that contains: |
Line 147 my @adderrors = ("ok",
|
Line 154 my @adderrors = ("ok",
|
my @installerrors = ("ok", |
my @installerrors = ("ok", |
"Initial user id of client not that of www", |
"Initial user id of client not that of www", |
"Usage error, not enough command line arguments", |
"Usage error, not enough command line arguments", |
"Source file name does not exist", |
"Source filename does not exist", |
"Destination file name does not exist", |
"Destination filename does not exist", |
"Some file operation failed", |
"Some file operation failed", |
"Invalid table filename." |
"Invalid table filename." |
); |
); |
Line 417 sub ReadManagerTable {
|
Line 424 sub ReadManagerTable {
|
|
|
my $tablename = $perlvar{'lonTabDir'}."/managers.tab"; |
my $tablename = $perlvar{'lonTabDir'}."/managers.tab"; |
if (!open (MANAGERS, $tablename)) { |
if (!open (MANAGERS, $tablename)) { |
logthis('<font color="red">No manager table. Nobody can manage!!</font>'); |
my $hostname = &Apache::lonnet::hostname($perlvar{'lonHostID'}); |
return; |
if (&Apache::lonnet::is_LC_dns($hostname)) { |
|
&logthis('<font color="red">No manager table. Nobody can manage!!</font>'); |
|
} |
|
return; |
} |
} |
while(my $host = <MANAGERS>) { |
while(my $host = <MANAGERS>) { |
chomp($host); |
chomp($host); |
Line 443 sub ReadManagerTable {
|
Line 453 sub ReadManagerTable {
|
} |
} |
} else { |
} else { |
logthis('<font color="green"> existing host'." $host</font>\n"); |
logthis('<font color="green"> existing host'." $host</font>\n"); |
$managers{&Apache::lonnet::get_host_ip($host)} = $host; # Use info from cluster tab if clumemeber |
$managers{&Apache::lonnet::get_host_ip($host)} = $host; # Use info from cluster tab if cluster memeber |
} |
} |
} |
} |
} |
} |
Line 505 sub AdjustHostContents {
|
Line 515 sub AdjustHostContents {
|
my $me = $perlvar{'lonHostID'}; |
my $me = $perlvar{'lonHostID'}; |
|
|
foreach my $line (split(/\n/,$contents)) { |
foreach my $line (split(/\n/,$contents)) { |
if(!(($line eq "") || ($line =~ /^ *\#/) || ($line =~ /^ *$/))) { |
if(!(($line eq "") || ($line =~ /^ *\#/) || ($line =~ /^ *$/) || |
|
($line =~ /^\s*\^/))) { |
chomp($line); |
chomp($line); |
my ($id,$domain,$role,$name,$ip,$maxcon,$idleto,$mincon)=split(/:/,$line); |
my ($id,$domain,$role,$name,$ip,$maxcon,$idleto,$mincon)=split(/:/,$line); |
if ($id eq $me) { |
if ($id eq $me) { |
Line 593 sub InstallFile {
|
Line 604 sub InstallFile {
|
# |
# |
# ConfigFileFromSelector: converts a configuration file selector |
# ConfigFileFromSelector: converts a configuration file selector |
# into a configuration file pathname. |
# into a configuration file pathname. |
# It's probably no longer necessary to preserve |
# Supports the following file selectors: |
# special handling of hosts or domain as those |
# hosts, domain, dns_hosts, dns_domain |
# files have been superceded by dns_hosts, dns_domain. |
|
# The default action is just to prepend the directory |
|
# and append .tab |
|
# |
# |
# |
# |
# Parameters: |
# Parameters: |
Line 610 sub ConfigFileFromSelector {
|
Line 618 sub ConfigFileFromSelector {
|
my $tablefile; |
my $tablefile; |
|
|
my $tabledir = $perlvar{'lonTabDir'}.'/'; |
my $tabledir = $perlvar{'lonTabDir'}.'/'; |
if ($selector eq "hosts") { |
if (($selector eq "hosts") || ($selector eq "domain") || |
$tablefile = $tabledir."hosts.tab"; |
($selector eq "dns_hosts") || ($selector eq "dns_domain")) { |
} elsif ($selector eq "domain") { |
|
$tablefile = $tabledir."domain.tab"; |
|
} else { |
|
$tablefile = $tabledir.$selector.'.tab'; |
$tablefile = $tabledir.$selector.'.tab'; |
} |
} |
return $tablefile; |
return $tablefile; |
|
|
} |
} |
# |
# |
# PushFile: Called to do an administrative push of a file. |
# PushFile: Called to do an administrative push of a file. |
Line 644 sub PushFile {
|
Line 648 sub PushFile {
|
# supported: |
# supported: |
# hosts.tab ($filename eq host). |
# hosts.tab ($filename eq host). |
# domain.tab ($filename eq domain). |
# domain.tab ($filename eq domain). |
|
# dns_hosts.tab ($filename eq dns_host). |
|
# dns_domain.tab ($filename eq dns_domain). |
# Construct the destination filename or reject the request. |
# Construct the destination filename or reject the request. |
# |
# |
# lonManage is supposed to ensure this, however this session could be |
# lonManage is supposed to ensure this, however this session could be |
Line 675 sub PushFile {
|
Line 681 sub PushFile {
|
return "error:$!"; |
return "error:$!"; |
} else { |
} else { |
&logthis('<font color="green"> Installed new '.$tablefile |
&logthis('<font color="green"> Installed new '.$tablefile |
."</font>"); |
." - transaction by: $clientname ($clientip)</font>"); |
|
my $adminmail = $perlvar{'lonAdmEMail'}; |
|
my $admindom = &Apache::lonnet::host_domain($perlvar{'lonHostID'}); |
|
if ($admindom ne '') { |
|
my %domconfig = |
|
&Apache::lonnet::get_dom('configuration',['contacts'],$admindom); |
|
if (ref($domconfig{'contacts'}) eq 'HASH') { |
|
if ($domconfig{'contacts'}{'adminemail'} ne '') { |
|
$adminmail = $domconfig{'contacts'}{'adminemail'}; |
|
} |
|
} |
|
} |
|
if ($adminmail =~ /^[^\@]+\@[^\@]+$/) { |
|
my $msg = new Mail::Send; |
|
$msg->to($adminmail); |
|
$msg->subject('LON-CAPA DNS update on '.$perlvar{'lonHostID'}); |
|
$msg->add('Content-type','text/plain; charset=UTF-8'); |
|
if (my $fh = $msg->open()) { |
|
print $fh 'Update to '.$tablefile.' from Cluster Manager '. |
|
"$clientname ($clientip)\n"; |
|
$fh->close; |
|
} |
|
} |
} |
} |
|
|
|
|
# Indicate success: |
# Indicate success: |
|
|
return "ok"; |
return "ok"; |
Line 1071 sub pong_handler {
|
Line 1097 sub pong_handler {
|
# Implicit Inputs: |
# Implicit Inputs: |
# $currenthostid - Global variable that carries the name of the host |
# $currenthostid - Global variable that carries the name of the host |
# known as. |
# known as. |
# $clientname - Global variable that carries the name of the hsot we're connected to. |
# $clientname - Global variable that carries the name of the host we're connected to. |
# Returns: |
# Returns: |
# 1 - Ok to continue processing. |
# 1 - Ok to continue processing. |
# 0 - Program should exit. |
# 0 - Program should exit. |
Line 1110 sub establish_key_handler {
|
Line 1136 sub establish_key_handler {
|
# Implicit Inputs: |
# Implicit Inputs: |
# $currenthostid - Global variable that carries the name of the host |
# $currenthostid - Global variable that carries the name of the host |
# known as. |
# known as. |
# $clientname - Global variable that carries the name of the hsot we're connected to. |
# $clientname - Global variable that carries the name of the host we're connected to. |
# Returns: |
# Returns: |
# 1 - Ok to continue processing. |
# 1 - Ok to continue processing. |
# 0 - Program should exit. |
# 0 - Program should exit. |
Line 1119 sub establish_key_handler {
|
Line 1145 sub establish_key_handler {
|
sub load_handler { |
sub load_handler { |
my ($cmd, $tail, $replyfd) = @_; |
my ($cmd, $tail, $replyfd) = @_; |
|
|
|
|
|
|
# Get the load average from /proc/loadavg and calculate it as a percentage of |
# Get the load average from /proc/loadavg and calculate it as a percentage of |
# the allowed load limit as set by the perl global variable lonLoadLim |
# the allowed load limit as set by the perl global variable lonLoadLim |
|
|
Line 1147 sub load_handler {
|
Line 1175 sub load_handler {
|
# Implicit Inputs: |
# Implicit Inputs: |
# $currenthostid - Global variable that carries the name of the host |
# $currenthostid - Global variable that carries the name of the host |
# known as. |
# known as. |
# $clientname - Global variable that carries the name of the hsot we're connected to. |
# $clientname - Global variable that carries the name of the host we're connected to. |
# Returns: |
# Returns: |
# 1 - Ok to continue processing. |
# 1 - Ok to continue processing. |
# 0 - Program should exit |
# 0 - Program should exit |
Line 1616 sub ls3_handler {
|
Line 1644 sub ls3_handler {
|
} |
} |
®ister_handler("ls3", \&ls3_handler, 0, 1, 0); |
®ister_handler("ls3", \&ls3_handler, 0, 1, 0); |
|
|
|
sub read_lonnet_global { |
|
my ($cmd,$tail,$client) = @_; |
|
my $userinput = "$cmd:$tail"; |
|
my $requested = &Apache::lonnet::thaw_unescape($tail); |
|
my $result; |
|
my %packagevars = ( |
|
spareid => \%Apache::lonnet::spareid, |
|
perlvar => \%Apache::lonnet::perlvar, |
|
); |
|
my %limit_to = ( |
|
perlvar => { |
|
lonOtherAuthen => 1, |
|
lonBalancer => 1, |
|
lonVersion => 1, |
|
lonSysEMail => 1, |
|
lonHostID => 1, |
|
lonRole => 1, |
|
lonDefDomain => 1, |
|
lonLoadLim => 1, |
|
lonUserLoadLim => 1, |
|
} |
|
); |
|
if (ref($requested) eq 'HASH') { |
|
foreach my $what (keys(%{$requested})) { |
|
my $response; |
|
my $items = {}; |
|
if (exists($packagevars{$what})) { |
|
if (ref($limit_to{$what}) eq 'HASH') { |
|
foreach my $varname (keys(%{$packagevars{$what}})) { |
|
if ($limit_to{$what}{$varname}) { |
|
$items->{$varname} = $packagevars{$what}{$varname}; |
|
} |
|
} |
|
} else { |
|
$items = $packagevars{$what}; |
|
} |
|
if ($what eq 'perlvar') { |
|
if (!exists($packagevars{$what}{'lonBalancer'})) { |
|
if ($dist =~ /^(centos|rhes|fedora|scientific)/) { |
|
my $othervarref=LONCAPA::Configuration::read_conf('httpd.conf'); |
|
if (ref($othervarref) eq 'HASH') { |
|
$items->{'lonBalancer'} = $othervarref->{'lonBalancer'}; |
|
} |
|
} |
|
} |
|
} |
|
$response = &Apache::lonnet::freeze_escape($items); |
|
} |
|
$result .= &escape($what).'='.$response.'&'; |
|
} |
|
} |
|
$result =~ s/\&$//; |
|
&Reply($client,\$result,$userinput); |
|
return 1; |
|
} |
|
®ister_handler("readlonnetglobal", \&read_lonnet_global, 0, 1, 0); |
|
|
|
sub server_devalidatecache_handler { |
|
my ($cmd,$tail,$client) = @_; |
|
my $userinput = "$cmd:$tail"; |
|
my ($name,$id) = map { &unescape($_); } split(/:/,$tail); |
|
&Apache::lonnet::devalidate_cache_new($name,$id); |
|
my $result = 'ok'; |
|
&Reply($client,\$result,$userinput); |
|
return 1; |
|
} |
|
®ister_handler("devalidatecache", \&server_devalidatecache_handler, 0, 1, 0); |
|
|
sub server_timezone_handler { |
sub server_timezone_handler { |
my ($cmd,$tail,$client) = @_; |
my ($cmd,$tail,$client) = @_; |
my $userinput = "$cmd:$tail"; |
my $userinput = "$cmd:$tail"; |
Line 1656 sub server_loncaparev_handler {
|
Line 1752 sub server_loncaparev_handler {
|
} |
} |
®ister_handler("serverloncaparev", \&server_loncaparev_handler, 0, 1, 0); |
®ister_handler("serverloncaparev", \&server_loncaparev_handler, 0, 1, 0); |
|
|
|
sub server_homeID_handler { |
|
my ($cmd,$tail,$client) = @_; |
|
my $userinput = "$cmd:$tail"; |
|
&Reply($client,\$perlvar{'lonHostID'},$userinput); |
|
return 1; |
|
} |
|
®ister_handler("serverhomeID", \&server_homeID_handler, 0, 1, 0); |
|
|
|
sub server_distarch_handler { |
|
my ($cmd,$tail,$client) = @_; |
|
my $userinput = "$cmd:$tail"; |
|
my $reply = &distro_and_arch(); |
|
&Reply($client,\$reply,$userinput); |
|
return 1; |
|
} |
|
®ister_handler("serverdistarch", \&server_distarch_handler, 0, 1, 0); |
|
|
# Process a reinit request. Reinit requests that either |
# Process a reinit request. Reinit requests that either |
# lonc or lond be reinitialized so that an updated |
# lonc or lond be reinitialized so that an updated |
# host.tab or domain.tab can be processed. |
# host.tab or domain.tab can be processed. |
Line 1765 sub authenticate_handler {
|
Line 1878 sub authenticate_handler {
|
# upass - User's password. |
# upass - User's password. |
# checkdefauth - Pass to validate_user() to try authentication |
# checkdefauth - Pass to validate_user() to try authentication |
# with default auth type(s) if no user account. |
# with default auth type(s) if no user account. |
|
# clientcancheckhost - Passed by clients with functionality in lonauth.pm |
|
# to check if session can be hosted. |
|
|
my ($udom, $uname, $upass, $checkdefauth)=split(/:/,$tail); |
my ($udom, $uname, $upass, $checkdefauth, $clientcancheckhost)=split(/:/,$tail); |
&Debug(" Authenticate domain = $udom, user = $uname, password = $upass, checkdefauth = $checkdefauth"); |
&Debug(" Authenticate domain = $udom, user = $uname, password = $upass, checkdefauth = $checkdefauth"); |
chomp($upass); |
chomp($upass); |
$upass=&unescape($upass); |
$upass=&unescape($upass); |
|
|
my $pwdcorrect = &validate_user($udom,$uname,$upass,$checkdefauth); |
my $pwdcorrect = &validate_user($udom,$uname,$upass,$checkdefauth); |
if($pwdcorrect) { |
if($pwdcorrect) { |
&Reply( $client, "authorized\n", $userinput); |
my $canhost = 1; |
|
unless ($clientcancheckhost) { |
|
my $uprimary_id = &Apache::lonnet::domain($udom,'primary'); |
|
my $uint_dom = &Apache::lonnet::internet_dom($uprimary_id); |
|
my @intdoms; |
|
my $internet_names = &Apache::lonnet::get_internet_names($clientname); |
|
if (ref($internet_names) eq 'ARRAY') { |
|
@intdoms = @{$internet_names}; |
|
} |
|
unless ($uint_dom ne '' && grep(/^\Q$uint_dom\E$/,@intdoms)) { |
|
my ($remote,$hosted); |
|
my $remotesession = &get_usersession_config($udom,'remotesession'); |
|
if (ref($remotesession) eq 'HASH') { |
|
$remote = $remotesession->{'remote'} |
|
} |
|
my $hostedsession = &get_usersession_config($clienthomedom,'hostedsession'); |
|
if (ref($hostedsession) eq 'HASH') { |
|
$hosted = $hostedsession->{'hosted'}; |
|
} |
|
$canhost = &Apache::lonnet::can_host_session($udom,$clientname, |
|
$clientversion, |
|
$remote,$hosted); |
|
} |
|
} |
|
if ($canhost) { |
|
&Reply( $client, "authorized\n", $userinput); |
|
} else { |
|
&Reply( $client, "not_allowed_to_host\n", $userinput); |
|
} |
# |
# |
# Bad credentials: Failed to authorize |
# Bad credentials: Failed to authorize |
# |
# |
Line 1927 sub add_user_handler {
|
Line 2070 sub add_user_handler {
|
."makeuser"; |
."makeuser"; |
} |
} |
unless ($fperror) { |
unless ($fperror) { |
my $result=&make_passwd_file($uname, $umode,$npass, $passfilename); |
my $result=&make_passwd_file($uname,$udom,$umode,$npass, $passfilename); |
&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 2002 sub change_authentication_handler {
|
Line 2145 sub change_authentication_handler {
|
&Failure($client, \$result); |
&Failure($client, \$result); |
} |
} |
} else { |
} else { |
my $result=&make_passwd_file($uname, $umode,$npass,$passfilename); |
my $result=&make_passwd_file($uname,$udom,$umode,$npass,$passfilename); |
# |
# |
# 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 2111 sub update_resource_handler {
|
Line 2254 sub update_resource_handler {
|
my $transname="$fname.in.transfer"; |
my $transname="$fname.in.transfer"; |
my $remoteurl=&Apache::lonnet::reply("sub:$fname","$clientname"); |
my $remoteurl=&Apache::lonnet::reply("sub:$fname","$clientname"); |
my $response; |
my $response; |
alarm(120); |
# FIXME: cannot replicate files that take more than two minutes to transfer? |
|
# alarm(120); |
|
# FIXME: this should use the LWP mechanism, not internal alarms. |
|
alarm(1200); |
{ |
{ |
my $ua=new LWP::UserAgent; |
my $ua=new LWP::UserAgent; |
my $request=new HTTP::Request('GET',"$remoteurl"); |
my $request=new HTTP::Request('GET',"$remoteurl"); |
Line 2119 sub update_resource_handler {
|
Line 2265 sub update_resource_handler {
|
} |
} |
alarm(0); |
alarm(0); |
if ($response->is_error()) { |
if ($response->is_error()) { |
|
# FIXME: we should probably clean up here instead of just whine |
unlink($transname); |
unlink($transname); |
my $message=$response->status_line; |
my $message=$response->status_line; |
&logthis("LWP GET: $message for $fname ($remoteurl)"); |
&logthis("LWP GET: $message for $fname ($remoteurl)"); |
} else { |
} else { |
if ($remoteurl!~/\.meta$/) { |
if ($remoteurl!~/\.meta$/) { |
|
# FIXME: isn't there an internal LWP mechanism for this? |
alarm(120); |
alarm(120); |
{ |
{ |
my $ua=new LWP::UserAgent; |
my $ua=new LWP::UserAgent; |
Line 2197 sub fetch_user_file_handler {
|
Line 2345 sub fetch_user_file_handler {
|
|
|
my $destname=$udir.'/'.$ufile; |
my $destname=$udir.'/'.$ufile; |
my $transname=$udir.'/'.$ufile.'.in.transit'; |
my $transname=$udir.'/'.$ufile.'.in.transit'; |
my $remoteurl='http://'.$clientip.'/userfiles/'.$fname; |
my $clientprotocol=$Apache::lonnet::protocol{$clientname}; |
|
$clientprotocol = 'http' if ($clientprotocol ne 'https'); |
|
my $clienthost = &Apache::lonnet::hostname($clientname); |
|
my $remoteurl=$clientprotocol.'://'.$clienthost.'/userfiles/'.$fname; |
my $response; |
my $response; |
Debug("Remote URL : $remoteurl Transfername $transname Destname: $destname"); |
Debug("Remote URL : $remoteurl Transfername $transname Destname: $destname"); |
alarm(120); |
alarm(120); |
Line 2219 sub fetch_user_file_handler {
|
Line 2370 sub fetch_user_file_handler {
|
unlink($transname); |
unlink($transname); |
&Failure($client, "failed\n", $userinput); |
&Failure($client, "failed\n", $userinput); |
} else { |
} else { |
|
if ($fname =~ /^default.+\.(page|sequence)$/) { |
|
my ($major,$minor) = split(/\./,$clientversion); |
|
if (($major < 2) || ($major == 2 && $minor < 11)) { |
|
my $now = time; |
|
&Apache::lonnet::do_cache_new('crschange',$udom.'_'.$uname,$now,600); |
|
my $key = &escape('internal.contentchange'); |
|
my $what = "$key=$now"; |
|
my $hashref = &tie_user_hash($udom,$uname,'environment', |
|
&GDBM_WRCREAT(),"P",$what); |
|
if ($hashref) { |
|
$hashref->{$key}=$now; |
|
if (!&untie_user_hash($hashref)) { |
|
&logthis("error: ".($!+0)." untie (GDBM) failed ". |
|
"when updating internal.contentchange"); |
|
} |
|
} |
|
} |
|
} |
&Reply($client, "ok\n", $userinput); |
&Reply($client, "ok\n", $userinput); |
} |
} |
} |
} |
Line 2373 sub user_has_session_handler {
|
Line 2542 sub user_has_session_handler {
|
|
|
my ($udom, $uname) = map { &unescape($_) } (split(/:/, $tail)); |
my ($udom, $uname) = map { &unescape($_) } (split(/:/, $tail)); |
|
|
&logthis("Looking for $udom $uname"); |
|
opendir(DIR,$perlvar{'lonIDsDir'}); |
opendir(DIR,$perlvar{'lonIDsDir'}); |
my $filename; |
my $filename; |
while ($filename=readdir(DIR)) { |
while ($filename=readdir(DIR)) { |
Line 3026 sub get_profile_keys {
|
Line 3194 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 3092 sub dump_profile_database {
|
Line 3271 sub dump_profile_database {
|
# that is matched against |
# that is matched against |
# database keywords to do |
# database keywords to do |
# selective dumps. |
# selective dumps. |
|
# range - optional range of entries |
|
# e.g., 10-20 would return the |
|
# 10th to 19th items, etc. |
# $client - Channel open on the client. |
# $client - Channel open on the client. |
# Returns: |
# Returns: |
# 1 - Continue processing. |
# 1 - Continue processing. |
Line 3101 sub dump_profile_database {
|
Line 3283 sub dump_profile_database {
|
sub dump_with_regexp { |
sub dump_with_regexp { |
my ($cmd, $tail, $client) = @_; |
my ($cmd, $tail, $client) = @_; |
|
|
|
my $res = LONCAPA::Lond::dump_with_regexp($tail, $clientversion); |
my $userinput = "$cmd:$tail"; |
|
|
if ($res =~ /^error:/) { |
my ($udom,$uname,$namespace,$regexp,$range)=split(/:/,$tail); |
Failure($client, \$res, "$cmd:$tail"); |
if (defined($regexp)) { |
|
$regexp=&unescape($regexp); |
|
} else { |
|
$regexp='.'; |
|
} |
|
my ($start,$end); |
|
if (defined($range)) { |
|
if ($range =~/^(\d+)\-(\d+)$/) { |
|
($start,$end) = ($1,$2); |
|
} elsif ($range =~/^(\d+)$/) { |
|
($start,$end) = (0,$1); |
|
} else { |
|
undef($range); |
|
} |
|
} |
|
my $hashref = &tie_user_hash($udom, $uname, $namespace, |
|
&GDBM_READER()); |
|
if ($hashref) { |
|
my $qresult=''; |
|
my $count=0; |
|
while (my ($key,$value) = each(%$hashref)) { |
|
if ($namespace eq 'roles') { |
|
if ($key =~ /^($LONCAPA::match_domain)_($LONCAPA::match_community)_(cc|co|in|ta|ep|ad|st|cr)/) { |
|
if ($clientversion =~ /^(\d+)\.(\d+)$/) { |
|
my $major = $1; |
|
my $minor = $2; |
|
next if (($major < 2) || (($major == 2) && ($minor < 9))); |
|
} |
|
} |
|
} |
|
if ($regexp eq '.') { |
|
$count++; |
|
if (defined($range) && $count >= $end) { last; } |
|
if (defined($range) && $count < $start) { next; } |
|
$qresult.=$key.'='.$value.'&'; |
|
} else { |
|
my $unescapeKey = &unescape($key); |
|
if (eval('$unescapeKey=~/$regexp/')) { |
|
$count++; |
|
if (defined($range) && $count >= $end) { last; } |
|
if (defined($range) && $count < $start) { next; } |
|
$qresult.="$key=$value&"; |
|
} |
|
} |
|
} |
|
if (&untie_user_hash($hashref)) { |
|
chop($qresult); |
|
&Reply($client, \$qresult, $userinput); |
|
} else { |
|
&Failure( $client, "error: ".($!+0)." untie(GDBM) Failed ". |
|
"while attempting dump\n", $userinput); |
|
} |
|
} else { |
} else { |
&Failure($client, "error: ".($!+0)." tie(GDBM) Failed ". |
Reply($client, \$res, "$cmd:$tail"); |
"while attempting dump\n", $userinput); |
|
} |
} |
|
|
return 1; |
return 1; |
Line 3728 sub put_course_id_hash_handler {
|
Line 3857 sub put_course_id_hash_handler {
|
# createdafter - include courses for which creation date followed this date. |
# createdafter - include courses for which creation date followed this date. |
# creationcontext - include courses created in specified context |
# creationcontext - include courses created in specified context |
# |
# |
|
# domcloner - flag to indicate if user can create CCs in course's domain. |
|
# If so, ability to clone course is automatic. |
|
# |
# $client - The socket open on the client. |
# $client - The socket open on the client. |
# Returns: |
# Returns: |
# 1 - Continue processing. |
# 1 - Continue processing. |
Line 3735 sub put_course_id_hash_handler {
|
Line 3867 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, |
$typefilter,$regexp_ok,$rtn_as_hash,$selfenrollonly,$catfilter,$showhidden, |
$typefilter,$regexp_ok,$rtn_as_hash,$selfenrollonly,$catfilter,$showhidden, |
$caller,$cloner,$cc_clone_list,$cloneonly,$createdbefore,$createdafter, |
$caller,$cloner,$cc_clone_list,$cloneonly,$createdbefore,$createdafter, |
$creationcontext) =split(/:/,$tail); |
$creationcontext,$domcloner) =split(/:/,$tail); |
my $now = time; |
my $now = time; |
my ($cloneruname,$clonerudom,%cc_clone); |
my ($cloneruname,$clonerudom,%cc_clone); |
if (defined($description)) { |
if (defined($description)) { |
Line 3813 sub dump_course_id_handler {
|
Line 3956 sub dump_course_id_handler {
|
} else { |
} else { |
$creationcontext = '.'; |
$creationcontext = '.'; |
} |
} |
|
|
my $unpack = 1; |
my $unpack = 1; |
if ($description eq '.' && $instcodefilter eq '.' && $coursefilter eq '.' && |
if ($description eq '.' && $instcodefilter eq '.' && $ownerfilter eq '.' && |
$typefilter eq '.') { |
$typefilter eq '.') { |
$unpack = 0; |
$unpack = 0; |
} |
} |
Line 3844 sub dump_course_id_handler {
|
Line 3986 sub dump_course_id_handler {
|
next if ($since > 1); |
next if ($since > 1); |
} |
} |
$is_hash = 1; |
$is_hash = 1; |
if (defined($clonerudom)) { |
if ($domcloner) { |
|
$canclone = 1; |
|
} elsif (defined($clonerudom)) { |
if ($items->{'cloners'}) { |
if ($items->{'cloners'}) { |
my @cloneable = split(',',$items->{'cloners'}); |
my @cloneable = split(',',$items->{'cloners'}); |
if (@cloneable) { |
if (@cloneable) { |
Line 3877 sub dump_course_id_handler {
|
Line 4021 sub dump_course_id_handler {
|
if ($items->{'owner'} eq $cloner) { |
if ($items->{'owner'} eq $cloner) { |
$canclone = 1; |
$canclone = 1; |
} |
} |
} elsif ($cloner eq $udom.':'.$items->{'owner'}) { |
} elsif ($cloner eq $items->{'owner'}.':'.$udom) { |
$canclone = 1; |
$canclone = 1; |
} |
} |
if ($canclone) { |
if ($canclone) { |
Line 4197 sub put_domain_handler {
|
Line 4341 sub put_domain_handler {
|
sub get_domain_handler { |
sub get_domain_handler { |
my ($cmd, $tail, $client) = @_; |
my ($cmd, $tail, $client) = @_; |
|
|
|
|
my $userinput = "$client:$tail"; |
my $userinput = "$client:$tail"; |
|
|
my ($udom,$namespace,$what)=split(/:/,$tail,3); |
my ($udom,$namespace,$what)=split(/:/,$tail,3); |
Line 4341 sub get_id_handler {
|
Line 4486 sub get_id_handler {
|
sub put_dcmail_handler { |
sub put_dcmail_handler { |
my ($cmd,$tail,$client) = @_; |
my ($cmd,$tail,$client) = @_; |
my $userinput = "$cmd:$tail"; |
my $userinput = "$cmd:$tail"; |
|
|
|
|
my ($udom,$what)=split(/:/,$tail); |
my ($udom,$what)=split(/:/,$tail); |
chomp($what); |
chomp($what); |
my $hashref = &tie_domain_hash($udom, "nohist_dcmail", &GDBM_WRCREAT()); |
my $hashref = &tie_domain_hash($udom, "nohist_dcmail", &GDBM_WRCREAT()); |
Line 4605 sub tmp_put_handler {
|
Line 4751 sub tmp_put_handler {
|
} |
} |
my ($id,$store); |
my ($id,$store); |
$tmpsnum++; |
$tmpsnum++; |
if ($context eq 'resetpw') { |
if (($context eq 'resetpw') || ($context eq 'createaccount')) { |
$id = &md5_hex(&md5_hex(time.{}.rand().$$)); |
$id = &md5_hex(&md5_hex(time.{}.rand().$$)); |
} else { |
} else { |
$id = $$.'_'.$clientip.'_'.$tmpsnum; |
$id = $$.'_'.$clientip.'_'.$tmpsnum; |
Line 4868 sub validate_instcode_handler {
|
Line 5014 sub validate_instcode_handler {
|
my ($dom,$instcode,$owner) = split(/:/, $tail); |
my ($dom,$instcode,$owner) = split(/:/, $tail); |
$instcode = &unescape($instcode); |
$instcode = &unescape($instcode); |
$owner = &unescape($owner); |
$owner = &unescape($owner); |
my ($outcome,$description) = |
my ($outcome,$description,$credits) = |
&localenroll::validate_instcode($dom,$instcode,$owner); |
&localenroll::validate_instcode($dom,$instcode,$owner); |
my $result = &escape($outcome).'&'.&escape($description); |
my $result = &escape($outcome).'&'.&escape($description).'&'. |
|
&escape($credits); |
&Reply($client, \$result, $userinput); |
&Reply($client, \$result, $userinput); |
|
|
return 1; |
return 1; |
Line 4923 sub get_sections_handler {
|
Line 5070 sub get_sections_handler {
|
sub validate_course_owner_handler { |
sub validate_course_owner_handler { |
my ($cmd, $tail, $client) = @_; |
my ($cmd, $tail, $client) = @_; |
my $userinput = "$cmd:$tail"; |
my $userinput = "$cmd:$tail"; |
my ($inst_course_id, $owner, $cdom) = split(/:/, $tail); |
my ($inst_course_id, $owner, $cdom, $coowners) = split(/:/, $tail); |
|
|
$owner = &unescape($owner); |
$owner = &unescape($owner); |
my $outcome = &localenroll::new_course($inst_course_id,$owner,$cdom); |
$coowners = &unescape($coowners); |
|
my $outcome = &localenroll::new_course($inst_course_id,$owner,$cdom,$coowners); |
&Reply($client, \$outcome, $userinput); |
&Reply($client, \$outcome, $userinput); |
|
|
|
|
Line 5914 if (-e $pidfile) {
|
Line 6062 if (-e $pidfile) {
|
$server = IO::Socket::INET->new(LocalPort => $perlvar{'londPort'}, |
$server = IO::Socket::INET->new(LocalPort => $perlvar{'londPort'}, |
Type => SOCK_STREAM, |
Type => SOCK_STREAM, |
Proto => 'tcp', |
Proto => 'tcp', |
Reuse => 1, |
ReuseAddr => 1, |
Listen => 10 ) |
Listen => 10 ) |
or die "making socket: $@\n"; |
or die "making socket: $@\n"; |
|
|
Line 5977 sub HUPSMAN { # sig
|
Line 6125 sub HUPSMAN { # sig
|
# a setuid perl script that can be root for us to do this job. |
# a setuid perl script that can be root for us to do this job. |
# |
# |
sub ReloadApache { |
sub ReloadApache { |
my $execdir = $perlvar{'lonDaemons'}; |
# --------------------------- Handle case of another apachereload process (locking) |
my $script = $execdir."/apachereload"; |
if (&LONCAPA::try_to_lock('/tmp/lock_apachereload')) { |
system($script); |
my $execdir = $perlvar{'lonDaemons'}; |
|
my $script = $execdir."/apachereload"; |
|
system($script); |
|
unlink('/tmp/lock_apachereload'); # Remove the lock file. |
|
} |
} |
} |
|
|
# |
# |
Line 6090 sub Debug {
|
Line 6242 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 6152 sub logstatus {
|
Line 6307 sub logstatus {
|
sub initnewstatus { |
sub initnewstatus { |
my $docdir=$perlvar{'lonDocRoot'}; |
my $docdir=$perlvar{'lonDocRoot'}; |
my $fh=IO::File->new(">$docdir/lon-status/londstatus.txt"); |
my $fh=IO::File->new(">$docdir/lon-status/londstatus.txt"); |
my $now=time; |
my $now=time(); |
my $local=localtime($now); |
my $local=localtime($now); |
print $fh "LOND status $local - parent $$\n\n"; |
print $fh "LOND status $local - parent $$\n\n"; |
opendir(DIR,"$docdir/lon-status/londchld"); |
opendir(DIR,"$docdir/lon-status/londchld"); |
Line 6241 $SIG{USR2} = \&UpdateHosts;
|
Line 6396 $SIG{USR2} = \&UpdateHosts;
|
|
|
# Read the host hashes: |
# Read the host hashes: |
&Apache::lonnet::load_hosts_tab(); |
&Apache::lonnet::load_hosts_tab(); |
|
my %iphost = &Apache::lonnet::get_iphost(1); |
|
|
my $dist=`$perlvar{'lonDaemons'}/distprobe`; |
$dist=`$perlvar{'lonDaemons'}/distprobe`; |
|
|
|
my $arch = `uname -i`; |
|
chomp($arch); |
|
if ($arch eq 'unknown') { |
|
$arch = `uname -m`; |
|
chomp($arch); |
|
} |
|
|
# -------------------------------------------------------------- |
# -------------------------------------------------------------- |
# Accept connections. When a connection comes in, it is validated |
# Accept connections. When a connection comes in, it is validated |
Line 6301 sub make_new_child {
|
Line 6464 sub make_new_child {
|
or die "Can't unblock SIGINT for fork: $!\n"; |
or die "Can't unblock SIGINT for fork: $!\n"; |
$children{$pid} = $clientip; |
$children{$pid} = $clientip; |
&status('Started child '.$pid); |
&status('Started child '.$pid); |
|
close($client); |
return; |
return; |
} else { |
} else { |
# Child can *not* return from this subroutine. |
# Child can *not* return from this subroutine. |
Line 6309 sub make_new_child {
|
Line 6473 sub make_new_child {
|
#don't get intercepted |
#don't get intercepted |
$SIG{USR1}= \&logstatus; |
$SIG{USR1}= \&logstatus; |
$SIG{ALRM}= \&timeout; |
$SIG{ALRM}= \&timeout; |
|
# |
|
# Block sigpipe as it gets thrownon socket disconnect and we want to |
|
# deal with that as a read faiure instead. |
|
# |
|
my $blockset = POSIX::SigSet->new(SIGPIPE); |
|
sigprocmask(SIG_BLOCK, $blockset); |
|
|
$lastlog='Forked '; |
$lastlog='Forked '; |
$status='Forked'; |
$status='Forked'; |
|
|
Line 6320 sub make_new_child {
|
Line 6491 sub make_new_child {
|
#---------------------------------------------------- kerberos 5 initialization |
#---------------------------------------------------- kerberos 5 initialization |
&Authen::Krb5::init_context(); |
&Authen::Krb5::init_context(); |
unless (($dist eq 'fedora5') || ($dist eq 'fedora4') || |
unless (($dist eq 'fedora5') || ($dist eq 'fedora4') || |
($dist eq 'fedora6') || ($dist eq 'suse9.3')) { |
($dist eq 'fedora6') || ($dist eq 'suse9.3') || |
|
($dist eq 'suse12.2') || ($dist eq 'suse12.3')) { |
&Authen::Krb5::init_ets(); |
&Authen::Krb5::init_ets(); |
} |
} |
|
|
Line 6365 sub make_new_child {
|
Line 6537 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: |
# |
# |
|
logthis("remotereq: $remotereq"); |
(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 |
|
# version when initiating the connection. For LON-CAPA 2.8 and older, |
|
# the version is retrieved from the global %loncaparevs in lonnet.pm. |
|
# $clientversion contains path to keyfile if $inittype eq 'local' |
|
# it's overridden below in this case |
|
$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 6393 sub make_new_child {
|
Line 6572 sub make_new_child {
|
my $cipherkey = pack("H32", $key); |
my $cipherkey = pack("H32", $key); |
$cipher = new IDEA($cipherkey); |
$cipher = new IDEA($cipherkey); |
print $client "ok:local\n"; |
print $client "ok:local\n"; |
&logthis('<font color="green"' |
&logthis('<font color="green">' |
. "Successful local authentication </font>"); |
. "Successful local authentication </font>"); |
$keymode = "local" |
$keymode = "local" |
} else { |
} else { |
Line 6457 sub make_new_child {
|
Line 6636 sub make_new_child {
|
# ------------------------------------------------------------ Process requests |
# ------------------------------------------------------------ Process requests |
my $keep_going = 1; |
my $keep_going = 1; |
my $user_input; |
my $user_input; |
|
my $clienthost = &Apache::lonnet::hostname($clientname); |
|
my $clientserverhomeID = &Apache::lonnet::get_server_homeID($clienthost); |
|
$clienthomedom = &Apache::lonnet::host_domain($clientserverhomeID); |
while(($user_input = get_request) && $keep_going) { |
while(($user_input = get_request) && $keep_going) { |
alarm(120); |
alarm(120); |
Debug("Main: Got $user_input\n"); |
Debug("Main: Got $user_input\n"); |
Line 6506 sub is_author {
|
Line 6688 sub is_author {
|
|
|
# Author role should show up as a key /domain/_au |
# Author role should show up as a key /domain/_au |
|
|
my $key = "/$domain/_au"; |
|
my $value; |
my $value; |
if (defined($hashref)) { |
if ($hashref) { |
$value = $hashref->{$key}; |
|
} |
|
|
|
if(defined($value)) { |
my $key = "/$domain/_au"; |
&Debug("$user @ $domain is an author"); |
if (defined($hashref)) { |
|
$value = $hashref->{$key}; |
|
if(!untie_user_hash($hashref)) { |
|
return 'error: ' . ($!+0)." untie (GDBM) Failed"; |
|
} |
|
} |
|
|
|
if(defined($value)) { |
|
&Debug("$user @ $domain is an author"); |
|
} |
|
} else { |
|
return 'error: '.($!+0)." tie (GDBM) Failed"; |
} |
} |
|
|
return defined($value); |
return defined($value); |
} |
} |
# |
# |
# Checks to see if the input roleput request was to set |
# Checks to see if the input roleput request was to set |
# an author role. If so, invokes the lchtmldir script to set |
# an author role. If so, creates construction space |
# up a correct public_html |
|
# Parameters: |
# Parameters: |
# request - The request sent to the rolesput subchunk. |
# request - The request sent to the rolesput subchunk. |
# We're looking for /domain/_au |
# We're looking for /domain/_au |
Line 6531 sub is_author {
|
Line 6720 sub is_author {
|
# |
# |
sub manage_permissions { |
sub manage_permissions { |
my ($request, $domain, $user, $authtype) = @_; |
my ($request, $domain, $user, $authtype) = @_; |
|
|
&Debug("manage_permissions: $request $domain $user $authtype"); |
|
|
|
# See if the request is of the form /$domain/_au |
# See if the request is of the form /$domain/_au |
if($request =~ /^(\/\Q$domain\E\/_au)$/) { # It's an author rolesput... |
if($request =~ /^(\/\Q$domain\E\/_au)$/) { # It's an author rolesput... |
my $execdir = $perlvar{'lonDaemons'}; |
my $path=$perlvar{'lonDocRoot'}."/priv/$domain"; |
my $userhome= "/home/$user" ; |
unless (-e $path) { |
&logthis("system $execdir/lchtmldir $userhome $user $authtype"); |
mkdir($path); |
&Debug("Setting homedir permissions for $userhome"); |
} |
system("$execdir/lchtmldir $userhome $user $authtype"); |
unless (-e $path.'/'.$user) { |
|
mkdir($path.'/'.$user); |
|
} |
} |
} |
} |
} |
|
|
Line 7029 sub subscribe {
|
Line 7217 sub subscribe {
|
# the metadata |
# the metadata |
unless ($fname=~/\.meta$/) { &unsub("$fname.meta",$clientip); } |
unless ($fname=~/\.meta$/) { &unsub("$fname.meta",$clientip); } |
$fname=~s/\/home\/httpd\/html\/res/raw/; |
$fname=~s/\/home\/httpd\/html\/res/raw/; |
$fname="http://".&Apache::lonnet::hostname($perlvar{'lonHostID'})."/".$fname; |
my $protocol = $Apache::lonnet::protocol{$perlvar{'lonHostID'}}; |
|
$protocol = 'http' if ($protocol ne 'https'); |
|
$fname=$protocol.'://'.&Apache::lonnet::hostname($perlvar{'lonHostID'})."/".$fname; |
$result="$fname\n"; |
$result="$fname\n"; |
} |
} |
} else { |
} else { |
Line 7071 sub change_unix_password {
|
Line 7261 sub change_unix_password {
|
|
|
|
|
sub make_passwd_file { |
sub make_passwd_file { |
my ($uname, $umode,$npass,$passfilename)=@_; |
my ($uname,$udom,$umode,$npass,$passfilename)=@_; |
my $result="ok"; |
my $result="ok"; |
if ($umode eq 'krb4' or $umode eq 'krb5') { |
if ($umode eq 'krb4' or $umode eq 'krb5') { |
{ |
{ |
Line 7112 sub make_passwd_file {
|
Line 7302 sub make_passwd_file {
|
# |
# |
my $uid = getpwnam($uname); |
my $uid = getpwnam($uname); |
if((defined $uid) && ($uid == 0)) { |
if((defined $uid) && ($uid == 0)) { |
&logthis(">>>Attempted to create privilged account blocked"); |
&logthis(">>>Attempt to create privileged account blocked"); |
return "no_priv_account_error\n"; |
return "no_priv_account_error\n"; |
} |
} |
|
|
Line 7124 sub make_passwd_file {
|
Line 7314 sub make_passwd_file {
|
&Debug("user = ".$uname.", Password =". $npass); |
&Debug("user = ".$uname.", Password =". $npass); |
my $se = IO::File->new("|$execpath > $perlvar{'lonDaemons'}/logs/lcuseradd.log"); |
my $se = IO::File->new("|$execpath > $perlvar{'lonDaemons'}/logs/lcuseradd.log"); |
print $se "$uname\n"; |
print $se "$uname\n"; |
|
print $se "$udom\n"; |
print $se "$npass\n"; |
print $se "$npass\n"; |
print $se "$npass\n"; |
print $se "$npass\n"; |
print $se "$lc_error_file\n"; # Status -> unique file. |
print $se "$lc_error_file\n"; # Status -> unique file. |
Line 7187 sub sethost {
|
Line 7378 sub sethost {
|
eq &Apache::lonnet::get_host_ip($hostid)) { |
eq &Apache::lonnet::get_host_ip($hostid)) { |
$currenthostid =$hostid; |
$currenthostid =$hostid; |
$currentdomainid=&Apache::lonnet::host_domain($hostid); |
$currentdomainid=&Apache::lonnet::host_domain($hostid); |
&logthis("Setting hostid to $hostid, and domain to $currentdomainid"); |
# &logthis("Setting hostid to $hostid, and domain to $currentdomainid"); |
} else { |
} else { |
&logthis("Requested host id $hostid not an alias of ". |
&logthis("Requested host id $hostid not an alias of ". |
$perlvar{'lonHostID'}." refusing connection"); |
$perlvar{'lonHostID'}." refusing connection"); |
Line 7202 sub version {
|
Line 7393 sub version {
|
return "version:$VERSION"; |
return "version:$VERSION"; |
} |
} |
|
|
|
sub get_usersession_config { |
|
my ($dom,$name) = @_; |
|
my ($usersessionconf,$cached)=&Apache::lonnet::is_cached_new($name,$dom); |
|
if (defined($cached)) { |
|
return $usersessionconf; |
|
} else { |
|
my %domconfig = &Apache::lonnet::get_dom('configuration',['usersessions'],$dom); |
|
if (ref($domconfig{'usersessions'}) eq 'HASH') { |
|
&Apache::lonnet::do_cache_new($name,$dom,$domconfig{'usersessions'},3600); |
|
return $domconfig{'usersessions'}; |
|
} |
|
} |
|
return; |
|
} |
|
|
|
|
|
|
|
|
|
sub distro_and_arch { |
|
return $dist.':'.$arch; |
|
} |
|
|
# ----------------------------------- POD (plain old documentation, CPAN style) |
# ----------------------------------- POD (plain old documentation, CPAN style) |
|
|
Line 7410 Place in B<logs/lond.log>
|
Line 7622 Place in B<logs/lond.log>
|
|
|
stores hash in namespace |
stores hash in namespace |
|
|
=item rolesputy |
=item rolesput |
|
|
put a role into a user's environment |
put a role into a user's environment |
|
|
Line 7527 Authen::Krb5
|
Line 7739 Authen::Krb5
|
|
|
=head1 COREQUISITES |
=head1 COREQUISITES |
|
|
|
none |
|
|
=head1 OSNAMES |
=head1 OSNAMES |
|
|
linux |
linux |
Line 7614 or the CA's certificate in the call to l
|
Line 7828 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 7735 Could not rewrite the
|
Line 7949 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 7764 lond has been asked to exit by its clien
|
Line 7978 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 7848 file when sent it's USR1 signal. That p
|
Line 8062 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 7862 Started a new child process for <client>
|
Line 8076 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 7873 In child process initialization. The pe
|
Line 8087 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 7923 The client (<client> is the peer's name
|
Line 8137 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. |
|
|
Line 7937 string.
|
Line 8151 string.
|
|
|
=back |
=back |
|
|
|
=back |
|
|
|
|
=cut |
=cut |