#!/usr/bin/perl -wI. # # Copyright (C) 2004 Peter Thoeny, peter@thoeny.com # # Quick and dirty utility to execute commands as the Apache user, use at your own risk! # Useful if you do not have root access on a hosted server. # # To install: # - copy qdexec to your twiki/bin directory # - add qdexec to .htaccess to require authentication (like the edit script) # - set $allowedUserName in the CONFIGURATION section below to the WikiName of the person # who is allowed to execute commands # # To use: # - uncomment a ready made command temporarily (or create your own) # - point your browser to http://your.server/cgi-bin/qdexec to execute the command # - comment out the command immediately after use # # WARNING: For security, uncomment ready made commands only temporarily! # BEGIN { # Set library paths in @INC at compile time unshift @INC, '.'; require 'setlib.cfg'; } # CONFIGURATION: my $allowedUserName = "FooBar"; use CGI::Carp qw(fatalsToBrowser); use CGI; use TWiki; open(STDERR,'>&STDOUT'); # redirect error to browser $| = 1; # no buffering print "Content-type: text/html\n\n"; print "
\n";
# uncomment and customize one of the following lines temporarily:
#print `ls $dataDir`;
#print `chmod 777 $dataDir/Trash`;
#print `chmod 777 $pubDir/Trash`;
#print `chmod 777 $pubDir/Trash/*`;
#print `kill -9 12345`;
print "\n";
print "