Security change for AIs
Posted: Mon Oct 12, 2009 1:36 pm
Hi,
I've found some troubles with oxp's that did use setAI recently. It's easy to make a subtle mistake and not be aware of it, thus I'd like some security change in oolite to prevent problems:
1) When a request is made to switch/set AI from AI A to AI A then simply change that AI state and probably also add a warning message to the log.
2) When circular AI requests are made (like AI A to AI B to AI A) then fall back to the requested AI which was suspended and exit the others. Also change that targets AI state and probably also add a warning message to the log.
I guess both cases can even be handled by one check if the check keeps both cases in mind. Furthermore, for case 2 it would be very difficult to prevent this from inside an oxp.
That would prevent unnecessarily growing AI stacks and AI overflow problems. Maybe that way the current AI limit could even be drastically reduced (if that helps in some way).
Screet
I've found some troubles with oxp's that did use setAI recently. It's easy to make a subtle mistake and not be aware of it, thus I'd like some security change in oolite to prevent problems:
1) When a request is made to switch/set AI from AI A to AI A then simply change that AI state and probably also add a warning message to the log.
2) When circular AI requests are made (like AI A to AI B to AI A) then fall back to the requested AI which was suspended and exit the others. Also change that targets AI state and probably also add a warning message to the log.
I guess both cases can even be handled by one check if the check keeps both cases in mind. Furthermore, for case 2 it would be very difficult to prevent this from inside an oxp.
That would prevent unnecessarily growing AI stacks and AI overflow problems. Maybe that way the current AI limit could even be drastically reduced (if that helps in some way).
Screet