This commit is contained in:
Matthew Raymer
2024-07-21 09:09:40 +00:00
parent 729333d4f5
commit dc3bd7f715
10072 changed files with 2703 additions and 2707 deletions
+2
View File
@@ -5,6 +5,8 @@ The following is a first list of the stuff we should know how to do.
ssh actswac@104.238.116.218 ssh actswac@104.238.116.218
Qbttxpsea1!
- Find names of software packages in the official CentOS repositories. - Find names of software packages in the official CentOS repositories.
Sample commands Sample commands
+10 -5
View File
@@ -11,10 +11,11 @@ require 'testlib.pl';
&traceoutput("login.pl"); # TRACE IF ACTIVE &traceoutput("login.pl"); # TRACE IF ACTIVE
&app_initialize; &app_initialize;
$SESSION{'temptime'} = time();
$SESSION{'temptime'} = time();
$SESSION{'clid'} = $FORM{'clid'}; $SESSION{'clid'} = $FORM{'clid'};
$SESSION{'lang'} = $FORM{'lang'}; $SESSION{'lang'} = $FORM{'lang'};
&get_client_configuration(); &get_client_configuration();
&traceoutput("login.pl:$FORM{'clid'}:$FORM{'uid'}:$FORM{'pwd'}"); # TRACE IF ACTIVE &traceoutput("login.pl:$FORM{'clid'}:$FORM{'uid'}:$FORM{'pwd'}"); # TRACE IF ACTIVE
&setbrowsertype(); &setbrowsertype();
@@ -28,13 +29,15 @@ if (! -x $testroot) {
if ($FORM{'selfregister'} eq "Y") { if ($FORM{'selfregister'} eq "Y") {
unless ($SESSION{'clid'}) { unless ($SESSION{'clid'}) {
warn "ERROR: Empty Client ID in Form $FORM{'clid'} " ; warn "ERROR: Empty Client ID in Form $FORM{'clid'} " ;
&show_illegal_access_warning("user"); print STDERR "ERROR: Empty Client ID in Form $FORM{'clid'} " ;
# &show_illegal_access_warning("user");
exit(); exit();
} }
&get_client_profile($SESSION{'clid'}); &get_client_profile($SESSION{'clid'});
unless (%CLIENT) { unless (%CLIENT) {
warn "ERROR: Invalid Client ID $FORM{'clid'} " ; warn "ERROR: Invalid Client ID $FORM{'clid'} " ;
&show_illegal_access_warning("user"); print STDERR "ERROR: Invalid Client ID $FORM{'clid'} " ;
# &show_illegal_access_warning("user");
exit(); exit();
} }
$CANDIDATE{'new'}="Y"; $CANDIDATE{'new'}="Y";
@@ -54,13 +57,15 @@ if ($FORM{'selfregister'} eq "Y") {
$vars{'direction'} = $FORM{'direction'} unless !(defined($FORM{'direction'})); $vars{'direction'} = $FORM{'direction'} unless !(defined($FORM{'direction'}));
unless ($SESSION{'clid'}) { unless ($SESSION{'clid'}) {
warn "ERROR: Empty Client ID in Form $FORM{'clid'} " ; warn "ERROR: Empty Client ID in Form $FORM{'clid'} " ;
&show_illegal_access_warning("user"); print STDERR "ERROR: Empty Client ID in Form $FORM{'clid'} " ;
# &show_illegal_access_warning("user");
exit(); exit();
} }
&get_client_profile($SESSION{'clid'}); &get_client_profile($SESSION{'clid'});
unless (%CLIENT || $SESSION{'clid'} eq 'std') { unless (%CLIENT || $SESSION{'clid'} eq 'std') {
warn "ERROR: Invalid Client ID $FORM{'clid'} " ; warn "ERROR: Invalid Client ID $FORM{'clid'} " ;
&show_illegal_access_warning("user"); print STDERR "ERROR: Invalid Client ID $FORM{'clid'} " ;
# &show_illegal_access_warning("user");
exit(); exit();
} }
if ($SESSION{'taclid'} ne '') { if ($SESSION{'taclid'} ne '') {
+18 -9
View File
@@ -4,7 +4,15 @@
# #
# Source File: sadmin.pl # Source File: sadmin.pl
#use strict;
use warnings;
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
#warningsToBrowser(1);
#fatalsToBrowser(1);
# Get config # Get config
require 'sitecfg.pl'; require 'sitecfg.pl';
require 'testlib.pl'; require 'testlib.pl';
@@ -12,18 +20,21 @@ require 'testlib.pl';
print "Content-Type: text/html\n\n"; print "Content-Type: text/html\n\n";
if (&get_session($FORM{'tid'})) { #print $logroot;
my $tid = $FORM{'tid'};
if (&get_session($tid)) {
&LanguageSupportInit(); &LanguageSupportInit();
unless ($SESSION{'clid'}) { unless ($SESSION{'clid'}) {
warn "ERROR: Empty Client ID in Session data for Session ID $FORM{'tid'} " ; warn "ERROR: Empty Client ID in Session data for Session ID $FORM{'tid'} " ;
&show_illegal_access_warning("user"); #&show_illegal_access_warning("user");
exit(); exit();
} }
if ($SESSION{'clid'} ne 'std') { if ($SESSION{'clid'} ne 'std') {
&get_client_profile($SESSION{'clid'}); &get_client_profile($SESSION{'clid'});
unless (%CLIENT) { unless (%CLIENT) {
warn "ERROR: Invalid Client ID $SESSION{'clid'} in Session ID $FORM{'tid'} " ; warn "ERROR: Invalid Client ID $SESSION{'clid'} in Session ID $FORM{'tid'} " ;
&show_illegal_access_warning("user"); #&show_illegal_access_warning("user");
exit(); exit();
} }
if ($SESSION{'uac'} eq 'admin' || $SESSION{'uac'} eq 'madmin') { if ($SESSION{'uac'} eq 'admin' || $SESSION{'uac'} eq 'madmin') {
@@ -34,7 +45,7 @@ if (&get_session($FORM{'tid'})) {
&get_candidate_profile($SESSION{'clid'}, $SESSION{'uid'}); &get_candidate_profile($SESSION{'clid'}, $SESSION{'uid'});
unless (%CANDIDATE) { unless (%CANDIDATE) {
warn "ERROR: Invalid Candidate ID $SESSION{'uid'} for Client $SESSION{'clid'} in Session ID $FORM{'tid'} " ; warn "ERROR: Invalid Candidate ID $SESSION{'uid'} for Client $SESSION{'clid'} in Session ID $FORM{'tid'} " ;
&show_illegal_access_warning("user"); #&show_illegal_access_warning("user");
exit(); exit();
} }
$FORM{'pageid'} = "Gradebook"; $FORM{'pageid'} = "Gradebook";
@@ -50,8 +61,6 @@ if (&get_session($FORM{'tid'})) {
$CLIENT{'emlaclstr'} =~ s/@//g; $CLIENT{'emlaclstr'} =~ s/@//g;
$CLIENT{'emlaclstr'} =~ s/,$//g; $CLIENT{'emlaclstr'} =~ s/,$//g;
if ($FORM{'idx'} eq '1') { if ($FORM{'idx'} eq '1') {
&log_entry($SESSION{'clid'}, $SESSION{'uid'}, "2", "SA/I"); &log_entry($SESSION{'clid'}, $SESSION{'uid'}, "2", "SA/I");
if ($SESSION{'uac'} eq 'admin' || $SESSION{'uac'} eq 'gadmin' || $SESSION{'uac'} eq 'madmin') { if ($SESSION{'uac'} eq 'admin' || $SESSION{'uac'} eq 'gadmin' || $SESSION{'uac'} eq 'madmin') {
@@ -207,11 +216,11 @@ if (&get_session($FORM{'tid'})) {
} elsif ($FORM{'dbop'} ne '') { } elsif ($FORM{'dbop'} ne '') {
&show_dbop_response; &show_dbop_response;
} else { } else {
&show_illegal_access_warning; #&show_illegal_access_warning("else1");
} }
} else { } else {
&logger::logerr("Unable to get session with &get_session($FORM{'tid'})"); &logger::logerr("Unable to get session with &get_session($FORM{'tid'})");
&show_illegal_access_warning; &show_illegal_access_warning("else2");
} }
sub show_license_request { sub show_license_request {
@@ -479,5 +488,5 @@ window.onmouseup=right;
} }
sub close_results { sub close_results {
print "</BODY>\n</HTML>\n"; print "<DIV>HERE</DIV></BODY>\n</HTML>\n";
} }
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
+3 -2
View File
@@ -75,14 +75,15 @@ $fieldsep = ';';
$idmax = 1000; $idmax = 1000;
$hostid = 4; $hostid = 4;
require 'smilib.pl'; require 'smilib.pl';
require 'cybertestlib.pl'; require 'cybertestlib.pl';
require 'maillib.pl'; require 'maillib.pl';
# #
# THIS IS DEVELOPMENT SETTING *ONLY*! DO NOT COMMIT THIS CHANGE!! # THIS IS DEVELOPMENT SETTING *ONLY*! DO NOT COMMIT THIS CHANGE!!
# #
$docroot = $ENV{DOCUMENT_ROOT}; $docroot = $ENV{DOCUMENT_ROOT};
$docroot =~ s/\/htdocs\s*$//g; $docroot =~ s/\/htdocs\s*$//g;
$urlroot = "/cgi-bin"; $urlroot = "/cgi-bin";
@@ -115,7 +116,7 @@ $PATHS{'pubroot'} = $pubroot;
$PATHS{'logroot'} = $logroot; $PATHS{'logroot'} = $logroot;
$PATHS{'dataroot'} = $dataroot; $PATHS{'dataroot'} = $dataroot;
$PATHS{'secroot'} = $secroot; $PATHS{'secroot'} = $secroot;
$PATHS{'logroot'} = $logroot; #$PATHS{'logroot'} = $logroot;
$PATHS{'resptmplt'} = $resptmplt; $PATHS{'resptmplt'} = $resptmplt;
$PATHS{'questionroot'} = $questionroot; $PATHS{'questionroot'} = $questionroot;
$PATHS{'testroot'} = $testroot; $PATHS{'testroot'} = $testroot;
+53 -79
View File
@@ -1,96 +1,70 @@
#!/usr/bin/perl #!/usr/bin/perl
#use strict;
#use warnings;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
require 'sitecfg.pl'; require 'sitecfg.pl';
require 'testlib.pl';
&traceoutput("visitor.pl:$ENV{'HTTP_REFERER'}"); # TRACE IF ACTIVE print "Content-type: text/plain\n\n";
&app_initialize; # Get user IDs
my $real_user_id = $<;
my $effective_user_id = $>;
print "Content-Type: text/html\n\n"; # Get group IDs
my $real_group_id = $(;
my $effective_group_id = $);
$mtime = time; # Get group names
$today = &format_date_time("yyyy-mm-dd hh:nn:ss GMT", "1", "-10000", $mtime); my $real_group_name = getgrgid($real_group_id);
my $effective_group_name = getgrgid($effective_group_id);
$stdvisitorlog = join($pathsep, $secroot, "visitsstd.dat"); # Print user and group information
$clidvisitorlog = join($pathsep, $secroot, "visits$FORM{'clid'}.dat"); print "Real User ID: $real_user_id\n";
$defaultvisitlog = join($pathsep, $secroot, "visits.dat"); print "Effective User ID: $effective_user_id\n";
print "Real Group ID: $real_group_id ($real_group_name)\n";
print "Effective Group ID: $effective_group_id ($effective_group_name)\n";
$msg = ""; my $cgi = CGI->new($ENV{'QUERY_STRING'});
if (($FORM{'clid'} eq '') || ($FORM{'clid'} eq 'sacc') || ($FORM{'clid'} eq 'std')) { my %FORM = $cgi->Vars;
open(VSTLOG,"<$stdvisitorlog") or $msg="not found";
if ($msg eq "not found") { my $session_id = $FORM{'tid'};
$makeok = &make_file($stdvisitorlog, $defaultvisitlog, 1);
$msg = ($makeok == 1) ? "" : "failed"; my $s_id = "sess.$session_id";
open(VSTLOG,"<$stdvisitorlog") or $msg="not found"; my $directory = join($pathsep, $logroot);
} my $trash = join($pathsep, $directory, $s_id);
if ($msg eq '') {
@visits = <VSTLOG>; if (-d $directory) {
close VSTLOG; print "Directory '$directory' exists.\n";
}
$litmplt = "shome"; # Check if the directory is readable
if (-r $directory) {
print "Directory '$directory' is readable.\n";
} else { } else {
open(VSTLOG,"<$clidvisitorlog") or $msg="not found"; print "Directory '$directory' is not readable.\n";
if ($msg eq "not found") {
$makeok = &make_file($clidvisitorlog, $stdvisitorlog, 1);
$msg = ($makeok == 1) ? "" : "failed";
open(VSTLOG,"<$clidvisitorlog") or $msg="not found";
}
if ($msg eq '') {
@visits = <VSTLOG>;
close VSTLOG;
}
$litmplt = "cindex";
$SESSION{'clid'} = $FORM{'clid'};
&get_client_profile($FORM{'clid'});
} }
if ($FORM{'lang'} eq '') { # Check if the directory is writable
$lastvisit = -1; if (-w $directory) {
for (1 .. $#visits) { print "Directory '$directory' is writable.\n";
@entries = split(/&/, $visits[$_]); } else {
if ($entries[1] eq $ENV{'REMOTE_ADDR'}) { print "Directory '$directory' is not writable.\n";
$lastvisit = $_;
}
}
if ($lastvisit == -1) {
@languages=split(/\,/,$ENV{'HTTP_ACCEPT_LANGUAGE'});
if ($languages[0] eq 'en') {$languages[0]="enu";}
if ($languages[0] eq 'en-us') {$languages[0]="enu";}
if ($languages[0] eq 'ar') {$languages[0]="arb";}
if ($LANGUAGE_ID{$languages[0]} ne '') {
$FORM{'lang'} = $languages[0];
} }
} else { } else {
@visitdata = split(/&/, $visits[$lastvisit]); print "Directory '$directory' does not exist.\n";
$idx = $#visitdata - 1;
$FORM{'lang'} = $visitdata[$idx];
@visitdata = ();
}
} }
@visits = (); # eval {
# open (my $SESSFILE, '>', $trash) or die "Could not open file '$trash': $!";
# print $SESSFILE "This is a test.\n";
# close($SESSFILE) or die "Could not close file '$trash': $!";
# };
&LanguageSupportInit(); # if ($@) {
# print $@
# }
$visitrec = join('&',$today,$ENV{'REMOTE_ADDR'},$ENV{'REMOTE_PORT'},$ENV{'HTTP_ACCEPT_LANGUAGE'},$ENV{'HTTP_USER_AGENT'},$SESSION{'lang'},""); #while (my ($key, $value) = each %FORM) {
if (($FORM{'clid'} eq '') || ($FORM{'clid'} eq 'sacc') || ($FORM{'clid'} eq 'std')) { # print "$key: $value\n";
open(VSTLOG,">>$stdvisitorlog"); #}
} else {
open(VSTLOG,">>$clidvisitorlog");
}
print VSTLOG "$visitrec\n";
close VSTLOG;
print "$litmplt\n";
print "--------------------------------------------------------------------------\n";
$SESSION{'browserapp'} = ($ENV{'HTTP_USER_AGENT'} =~ /MSIE/ ) ? "MSIE" : "NSNV";
&traceoutput("visitor.pl:$litmplt"); # TRACE IF ACTIVE
&show_template($litmplt);
print "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
print "Content-type: text/html\n\n";
print "<html><body><h1>Test CGI Script</h1></body></html>\n\n";
print "\n\n";
print "$docroot\n";
print "$secroot\n";
print $resptmplt;
print "\n\n";
+7 -2
View File
@@ -2,8 +2,13 @@
name="fcgiwrap" name="fcgiwrap"
description="Simple server for running CGI applications over FastCGI" description="Simple server for running CGI applications over FastCGI"
command="/usr/bin/spawn-fcgi" command="/usr/bin/spawn-fcgi"
command_args="-s /var/run/fcgiwrap.socket -u nobody -g nogroup -P /var/run/fcgiwrap.pid /usr/bin/fcgiwrap > /var/log/fcgiwrap.log 2>&1" command_user="nginx:nginx"
command_args="-s /var/run/fcgiwrap.socket -u nginx -g nginx -P /var/run/fcgiwrap.pid /usr/bin/fcgiwrap > /var/log/fcgiwrap.log 2>&1"
pidfile="/var/run/fcgiwrap.pid" pidfile="/var/run/fcgiwrap.pid"
depend() {
use net
after nginx
}
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File

Some files were not shown because too many files have changed in this diff Show More