#!/usr/bin/perl ############################## # gBasic Programming - gigasoft2@webtv.net # # Script : Chmodder # Version : n/a # # Description : # Change the permissions of a file. # # Requirements : CGI module # # Variables : # # $disable # Set to 1 to disable script, so noone can use it. # Set to 0 to enable script again. # # Policy : # You may use this program free of charge as long as # the comments and credit remain intact. ############################## use CGI qw(param); $filech = param("filetochmod"); $chnum = param("chmodnumber"); $disable = 0; $faction = $ENV{'REQUEST_URI'}; if ($disable) { &output_error("Script is disabled"); } print "Content-Type: text/html\n\n"; &printtop; if ($filech && $chnum) { &chmodfile($chnum, $filech); } &printtail; exit; sub chmodfile { local($a, $b) = @_; local($dochmod) = `chmod $a $b`; chop($dochmod); print $dochmod; print "Chmod executed!"; } sub printtop { print ""; print "
"; print ""; print $errormsg; print ""; print ""; exit; }