#!/opt/bin/perl -Tw use strict; use English; # long names for special variables use CGI qw(:standard); use CGI::Carp 'fatalsToBrowser'; $OUTPUT_AUTOFLUSH = 1; # flush output buffer after each output statement ... # ... slower but helpful for output over the network $OUTPUT_RECORD_SEPARATOR = "\n"; print header; # to generate document-type print XHTMLhead(); middle(); print XHTMLtail(); # -- subroutines follow -- # sub middle { my $real_ID = $REAL_USER_ID; my $effect_ID = $EFFECTIVE_USER_ID; my $real_name = (getpwuid $real_ID)[0]; my $effect_name = (getpwuid $effect_ID)[0]; print "
"; print " This program is being run by the user with"; print " ID $real_ID (", $real_name,")"; printf "%s ", ($real_ID == $effect_ID) ?"and" :"but"; print "the effective user ID is $effect_ID (", $effect_name, ")."; print "
"; if ($real_ID != $effect_ID) { print "Therefore the program is running as suid."; } elsif ($real_name =~ /^http/) { print "It looks like the program is being run by the server."; } else { print "It looks like the program is being run under suexec."; } print "
"; print "Name | Value |
---|---|
$name | $value |
%s | %s |
%s | %vd |