[Tutor] Re: Suggestions for cleaner code

Magnus Lyckå magnus@thinkware.se
Wed Jul 9 10:46:28 2003


At 18:02 2003-07-08 -0700, Jeff Shannon wrote:
>Even worse, someone could easily type something like 'import os; 
>os.system("rm -s /")' -- this *will* import the os module and spawn a 
>shell that will attempt to delete every file on your system.

No it won't. You can only evaluate expressions, not arbitrary
statements. But the second part 'os.system("rm -s /")' is
certainly possible, so if the program has already imported
the os module, you are definitely in danger.


--
Magnus Lycka (It's really Lyckå), magnus@thinkware.se
Thinkware AB, Sweden, www.thinkware.se
I code Python ~ The Agile Programming Language