Ian
01-10-2007, 05:49 AM
It might be prudent to disable part of the Lua standard library. (Although it's probably not that big of a concern.)
I think the easiest way to do it is just to set the offending packages/methods to nil in the Novashell/system scripts. Sure, someone can edit them, but that only effects their own system. There's probably another way to do this in C though. As far as I can tell, the only packages that warrant concern are io and os. os.execute("rm *") :)
The os package contains all the scary stuff like os.execute. Unless people want to be able to know what the current time and date is, the whole package can be set to nil. Otherwise, os.remove, os.rename, and os.execute should be. os.setlocale should probably be too as changing the locale is asking for trouble. os.exit might bypass clean-up code, and os.tmpname is useless if file IO is disabled.
I think the easiest way to do it is just to set the offending packages/methods to nil in the Novashell/system scripts. Sure, someone can edit them, but that only effects their own system. There's probably another way to do this in C though. As far as I can tell, the only packages that warrant concern are io and os. os.execute("rm *") :)
The os package contains all the scary stuff like os.execute. Unless people want to be able to know what the current time and date is, the whole package can be set to nil. Otherwise, os.remove, os.rename, and os.execute should be. os.setlocale should probably be too as changing the locale is asking for trouble. os.exit might bypass clean-up code, and os.tmpname is useless if file IO is disabled.