rexec questions

Roman Suzi rnd at onego.ru
Fri Aug 3 14:54:28 EDT 2001


I tried the following in Python 2.1 and it raised suspicions
if rexec works correctly:

>>> import rexec
>>> rexec.RExec.ok_builtin_modules
('audioop', 'array', 'binascii', 'cmath', 'errno', 'imageop', 'marshal',
'math', 'md5', 'operator', 'parser', 'regex', 'pcre', 'rotor', 'select',
'strop', 'struct', 'time')
>>> rexec.RExec().r_exec("import popen2; print dir(popen2.os)")
['__all__', '__builtins__', '__doc__', '__file__', '__name__', '_execvpe',
'_exists', '_get_exports_list', '_notfound', 'altsep', 'curdir',
'defpath', 'environ', 'error', 'execl', 'execle', 'execlp', 'execlpe',
'execvp', 'execvpe', 'fstat', 'getcwd', 'getegid', 'geteuid', 'getgid',
'getpid', 'getppid', 'getuid', 'linesep', 'listdir', 'lstat', 'makedirs',
'name', 'pardir', 'path', 'pathsep', 'readlink', 'removedirs', 'renames',
'sep', 'stat', 'sys', 'times', 'uname']

I thought that it could import ONLY rexec.RExec.ok_builtin_modules!
(Though, popen2.os is restricted correctly). Is rexec smarter these
days or does it restrict loading only dynamic (written in C) modules?

And also, is ther any way to restrict programs from contacting
hosts outside some list? If I understood correctly, networking
in rexec is all-or-nothing...

Sincerely yours, Roman Suzi
-- 
_/ Russia _/ Karelia _/ Petrozavodsk _/ rnd at onego.ru _/
_/ Friday, August 03, 2001 _/ Powered by Linux RedHat 6.2 _/
_/ "MACINTOSH - Most Apps Crash, If Not, Then Operating System Hangs" _/





More information about the Python-list mailing list