You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

70 lines
1.7 KiB

#!/usr/bin/perl
#use strict;
#use warnings;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
require 'sitecfg.pl';
print "Content-type: text/plain\n\n";
# Get user IDs
my $real_user_id = $<;
my $effective_user_id = $>;
# Get group IDs
my $real_group_id = $(;
my $effective_group_id = $);
# Get group names
my $real_group_name = getgrgid($real_group_id);
my $effective_group_name = getgrgid($effective_group_id);
# Print user and group information
print "Real User ID: $real_user_id\n";
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";
my $cgi = CGI->new($ENV{'QUERY_STRING'});
my %FORM = $cgi->Vars;
my $session_id = $FORM{'tid'};
my $s_id = "sess.$session_id";
my $directory = join($pathsep, $logroot);
my $trash = join($pathsep, $directory, $s_id);
if (-d $directory) {
print "Directory '$directory' exists.\n";
# Check if the directory is readable
if (-r $directory) {
print "Directory '$directory' is readable.\n";
} else {
print "Directory '$directory' is not readable.\n";
}
# Check if the directory is writable
if (-w $directory) {
print "Directory '$directory' is writable.\n";
} else {
print "Directory '$directory' is not writable.\n";
}
} else {
print "Directory '$directory' does not exist.\n";
}
# 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': $!";
# };
# if ($@) {
# print $@
# }
#while (my ($key, $value) = each %FORM) {
# print "$key: $value\n";
#}