Author: justi9
Date: 2010-08-27 12:36:59 -0400 (Fri, 27 Aug 2010)
New Revision: 4240
Modified:
mgmt/newdata/cumin/python/cumin/grid/submission.py
Log:
Prevent users from overriding job credentials
Modified: mgmt/newdata/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-08-27 16:24:11 UTC (rev 4239)
+++ mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-08-27 16:36:59 UTC (rev 4240)
@@ -194,6 +194,8 @@
self.input.columns = 50
+ self.illegal_attributes = ("owner", "user")
+
def render_title(self, session):
return "Extra attributes"
@@ -212,11 +214,17 @@
try:
name, value = self.parse_attribute(line)
except:
- error = FormError("Failed parsing attribute: %s" % line)
- self.form.errors.get(session).append(error)
+ msg = "Failed parsing attribute '%s'" % line
+ self.form.errors.get(session).append(FormError(msg))
continue
+ if name.lower() in self.illegal_attributes:
+ msg = "Setting extra attribute '%s' is prohibited" %
name
+ self.form.errors.get(session).append(FormError(msg))
+
+ continue
+
attrs[name] = value
return attrs
Show replies by date