## check if the script is valid (the marker file must be in the same directory)
if not checkIfEventScriptIsValid(plugin):
raise Exception, "the event script (%s) does not reside in a directory with the marker file (%s) - this is not allowed due to abuse prevention" % (plugin,EVENT_MARKER)
## check if the event (and its parents) are only writeable for root
if not checkIfFileIsSafe(event):
raise Exception, "the event (%s) is not safe - check its (and its parents') permissions" % event
args.insert(0,event)
proc = subprocess.Popen(
shell = False,
args = args)
@ -374,12 +386,12 @@ if __name__ == "__main__":
else:
sys.exit(1)
if args[0].lower() == "hook":
if args[0].lower() == "event":
del args[0]
try:
isOK = call_hook(args)
isOK = call_event(args)
except Exception, errMsg:
sys.stderr.write("Execution of hook script failed: %s\n" % errMsg)
sys.stderr.write("Execution of event script failed: %s\n" % errMsg)