W
Wojciech Pawlikowski
Hey,
I work on some project where main part (core) is coded in C
(for speed) and the rest is in Python. Python API is used
to launch python modules without using any exec() system()
calls (thread safe). During debugging I found that
many of Python modules fails to work because restricted mode:
Traceback (most recent call last):
File "../modules/scan/dns_forward.py", line 167, in scan_element
d = DNSForward(domainname)
File "../modules/scan/dns_forward.py", line 20, in __init__
self.__r = dns.resolver.Resolver()
File "/usr/lib/python2.4/site-packages/dns/resolver.py", line 270, in
__init__
self.read_resolv_conf(filename)
File "/usr/lib/python2.4/site-packages/dns/resolver.py", line 295, in
read_resolv_conf
f = open(f, 'r')
IOError: file() constructor not accessible in restricted mode
Is there any way to avoid this mode ?
I work on some project where main part (core) is coded in C
(for speed) and the rest is in Python. Python API is used
to launch python modules without using any exec() system()
calls (thread safe). During debugging I found that
many of Python modules fails to work because restricted mode:
Traceback (most recent call last):
File "../modules/scan/dns_forward.py", line 167, in scan_element
d = DNSForward(domainname)
File "../modules/scan/dns_forward.py", line 20, in __init__
self.__r = dns.resolver.Resolver()
File "/usr/lib/python2.4/site-packages/dns/resolver.py", line 270, in
__init__
self.read_resolv_conf(filename)
File "/usr/lib/python2.4/site-packages/dns/resolver.py", line 295, in
read_resolv_conf
f = open(f, 'r')
IOError: file() constructor not accessible in restricted mode
Is there any way to avoid this mode ?