If the optional arg is given, the call_other()s are followed back i times (i.e. previous_object(2) returns the caller of the caller). 0 <= i <= caller_stack_depth()-1
int security() {
object prev;
if(!(prev=previous_object()));
else if(getuid(prev)!=getuid(this_object()));
else if(geteuid(prev)!=geteuid(this_object()));
else return 1;
return 0;
}
void high_sensible_func() {
if(!security())
return;
...
}
This example shows how we can check if the last call to a
function of the current object is secure or if we should abort
execution.