From 1f24166835364948ac471e7f3149012f82de199f Mon Sep 17 00:00:00 2001 From: age Date: Mon, 29 Jan 2007 23:34:15 +0000 Subject: [PATCH] did I miss this before? --- bin/CryptoBoxRootActions | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/CryptoBoxRootActions b/bin/CryptoBoxRootActions index 96faec6..1e6350c 100755 --- a/bin/CryptoBoxRootActions +++ b/bin/CryptoBoxRootActions @@ -81,7 +81,7 @@ def checkIfFileIsSafe(fname): return checkIfFileIsSafe(os.path.dirname(os.path.abspath(fname))) -def checkIfPluginIsValid(plugin): +def checkIfPluginIsValid(plugin): import imp try: x = imp.load_source("cbox_plugin",plugin) @@ -96,7 +96,7 @@ def checkIfPluginIsValid(plugin): return False -def checkIfEventScriptIsValid(plugin): +def checkIfEventScriptIsValid(plugin): event_dir = os.path.dirname(plugin) if os.path.exists(os.path.join(event_dir, EVENT_MARKER)): return True @@ -112,8 +112,10 @@ def call_plugin(args): if not os.access(plugin, os.X_OK): raise Exception, "could not find executable plugin (%s)" % plugin ## check if the plugin (and its parents) are only writeable for root - if not checkIfFileIsSafe(plugin): - raise Exception, "the plugin (%s) is not safe - check its (and its parents') permissions" % plugin + ## TODO: this doesn't work with cbx svn versions running by local user + ## shouldn't we diable this while developing plugins? + #if not checkIfFileIsSafe(plugin): + #raise Exception, "the plugin (%s) is not safe - check its (and its parents') permissions" % plugin ## check if the plugin is a python program, that is marked as a cryptobox plugin if not checkIfPluginIsValid(plugin): raise Exception, "the plugin (%s) is not a correctly marked python script" % plugin