--- source-trees/gt2-cvs/gram/jobmanager/setup/program/globus-job-manager-script.in.orig Fri Aug 5 13:39:01 2005 +++ source-trees/gt2-cvs/gram/jobmanager/setup/program/globus-job-manager-script.in Wed Oct 4 16:48:52 2006 @@ -1,5 +1,10 @@ #! @PERL@ +# Replace this with your command filtering programing of choice. +# A return value of '0' indicates that the command will be allowed, and +# any other return value indicates that the command will be denied. +#$FILTER_COMMAND = '/usr/local/bin/commsh --check-user'; + BEGIN { use Config; @@ -75,8 +80,20 @@ # If we are submitting a job, we may need to update things like # executable & stdin to look in the cache. +# We may also need to run the command through a filter script. if($command eq 'submit') { + if(defined $FILTER_COMMAND) + { + local $commandName = join(" ", $job_description->executable, + $job_description->arguments); + local @filterArgs = split(/\s+/, $FILTER_COMMAND); + local $rVal = (system(@filterArgs, $commandName)) >> 8; + if($rVal != 0) # The filter command returned an error, so deny. + { + &fail(Globus::GRAM::Error::AUTHORIZATION_DENIED_EXECUTABLE); + } + } $manager->rewrite_urls(); } $result = $manager->$command();