open == file considered harmful (Re: [Python-Dev] RE: rexec.pyunuseable)

Greg Ewing greg at cosc.canterbury.ac.nz
Thu Dec 18 16:33:22 EST 2003


Nick Coghlan <ncoghlan at iinet.net.au>:

> What if instead of 'builtin behaves differently in restricted mode' we 
> had 'restricted __builtins__ contains a DIFFERENT builtin, that happens 
> to have the same name'?

That wouldn't solve the file problem, because if the restricted
code ever got hold of a file object created by unrestricted code,
it would have access to the "real" file class which can open
any file.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+



More information about the Python-Dev mailing list