
July 10th, 2012, 07:26 PM
|
 |
Contributing User
|
|
|
|
Do you intend this program?
Code:
def privilege(min_clearance):
if NAKED not in argv:
def wrapper(argfunc):
def clearancecheck(tag, *args):
if tag.clearance < min_clearance:
global log_file
if log_file:
log_file.write(
stack().pop()+" with clearance "
+ str(tag.clearance) + "called"
+ argfunc.__name__ + "with min clearance"
+ str(min_clearance )+ '\n')
raise SecurityBreach(min_clearance,tag.clearance)
else:
return argfunc
else:
def wrapper(argfunc):
return argfunc
return wrapper
What is argfunc ?
What is the purpose of clearancecheck ? It is difficult to access.
What is NAKED ?
What is the context?
What is the command line?
What is argv ?
What version of python do you use?
Yes, this interactive python console snippet raises an exception:
>>> None()
__________________
[code] Code tags[/code] are essential for python code!
|