did I miss this before?
This commit is contained in:
parent
6d0975d32f
commit
1f24166835
|
@ -81,7 +81,7 @@ def checkIfFileIsSafe(fname):
|
||||||
return checkIfFileIsSafe(os.path.dirname(os.path.abspath(fname)))
|
return checkIfFileIsSafe(os.path.dirname(os.path.abspath(fname)))
|
||||||
|
|
||||||
|
|
||||||
def checkIfPluginIsValid(plugin):
|
def checkIfPluginIsValid(plugin):
|
||||||
import imp
|
import imp
|
||||||
try:
|
try:
|
||||||
x = imp.load_source("cbox_plugin",plugin)
|
x = imp.load_source("cbox_plugin",plugin)
|
||||||
|
@ -96,7 +96,7 @@ def checkIfPluginIsValid(plugin):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def checkIfEventScriptIsValid(plugin):
|
def checkIfEventScriptIsValid(plugin):
|
||||||
event_dir = os.path.dirname(plugin)
|
event_dir = os.path.dirname(plugin)
|
||||||
if os.path.exists(os.path.join(event_dir, EVENT_MARKER)):
|
if os.path.exists(os.path.join(event_dir, EVENT_MARKER)):
|
||||||
return True
|
return True
|
||||||
|
@ -112,8 +112,10 @@ def call_plugin(args):
|
||||||
if not os.access(plugin, os.X_OK):
|
if not os.access(plugin, os.X_OK):
|
||||||
raise Exception, "could not find executable plugin (%s)" % plugin
|
raise Exception, "could not find executable plugin (%s)" % plugin
|
||||||
## check if the plugin (and its parents) are only writeable for root
|
## check if the plugin (and its parents) are only writeable for root
|
||||||
if not checkIfFileIsSafe(plugin):
|
## TODO: this doesn't work with cbx svn versions running by local user
|
||||||
raise Exception, "the plugin (%s) is not safe - check its (and its parents') permissions" % plugin
|
## 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
|
## check if the plugin is a python program, that is marked as a cryptobox plugin
|
||||||
if not checkIfPluginIsValid(plugin):
|
if not checkIfPluginIsValid(plugin):
|
||||||
raise Exception, "the plugin (%s) is not a correctly marked python script" % plugin
|
raise Exception, "the plugin (%s) is not a correctly marked python script" % plugin
|
||||||
|
|
Loading…
Reference in a new issue