473,657 Members | 2,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

restricted mode (2.4.2)

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(doma inname)
File "../modules/scan/dns_forward.py" , line 20, in __init__
self.__r = dns.resolver.Re solver()
File "/usr/lib/python2.4/site-packages/dns/resolver.py", line 270, in
__init__
self.read_resol v_conf(filename )
File "/usr/lib/python2.4/site-packages/dns/resolver.py", line 295, in
read_resolv_con f
f = open(f, 'r')
IOError: file() constructor not accessible in restricted mode

Is there any way to avoid this mode ?

--
_______________ _______________ _______________ _______________ _______
* Wojciech Pawlikowski :: <wojtekp AT gmail.com> :: GG: 4155781 *
* http://www.knockdownhc.com || http://www.kingofthehillhc.com *
* "Loved by a few, Hated by many, But respected by ALL" *
Feb 17 '06 #1
0 1023

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1300
by: Denis S. Otkidach | last post by:
When I execute python code from C++ application with PyEval_EvalCode and this code contains imports of other modules then I got the error "RuntimeError: cannot unmarshal code objects in restricted execution mode". How can I switch into noraml (unrestricted) mode? Python 2.2.2, Linux. Actual code looks like the following: tstate = Py_NewInterpreter(); main_module = PyImport_AddModule("__main__");
13
4011
by: Rolf Magnus | last post by:
Hi, I would like to embed a python interpreter within a program, but since that program would be able to automatically download scripts from the internet, I'd like to run those in a restricted environment, which basically means that I want to allow only a specific set of modules to be used by the scripts, so that it wouldn't be possible for them to remove files from the hard drive, kill processes or do other nasty stuff. Is there any...
4
2452
by: David Lozzi | last post by:
Session("UID") = 10 Session("Name") = "John Doe" I have an ASP application loaded on a Win2k SP3 server in Anonymous Authentication Mode. When I try to access the site, none of the session variables work. I have to lower the security to Low in Internet Explorer for the session variables to run. BUT if I run this same script on my local machine (WinXP Pro sp1) it works fine with whatever security level i have. Also, i have another ASP...
15
2080
by: vinjvinj | last post by:
I have an application which allows multiple users to write models. These models get distributed on a grid of compute engines. users submit their models through a web interface. I want to 1. restrict the user from doing any file io, exec, import, eval, etc. I was thinking of writing a plugin for pylint to do all the checks? Is this is a good way given that there is no restricted python. What are the things I should serach for in python...
0
256
by: SamIAm | last post by:
Hi I have the following in my web.config to specify that all my pages require authorization: <authentication mode="Forms"> <forms loginUrl="Login.aspx" timeout="60" path="/">
0
1089
by: gabriel.becedillas | last post by:
Hi, At the company I work for we've embedded Python 2.4.1 in a C++ application. We execute multiple scripts concurrenlty, each one in its own interpreter (created using Py_NewInterpreter()). We are sharing a certain instance between interpreters because its to expensive to instantiate that class every time an interpreter is created. The class is instantiated in the main interpreter (that is always alive) and every time a new interpreter...
18
4220
by: Markalon | last post by:
I've tried to find the answer to this one already but couldn't find it in the forum. What does IOError: file() constructor not accessible in restricted mode mean? Here is the code that is giving me the error: def checkCal():
3
2535
by: Dmitri Fedoruk | last post by:
Hello everyone, I'm developing a mod_python application that is based on XML\XSLT transforming. I used 4Suite libraries for that, but as the speed was unacceptable for me, I switched to lxml. Everything became much easier and 10 times faster, but I've encountered the subject problem. In brief - all my data and xslt are stored and transferred in UTF-8.
3
2633
by: Paul Rudin | last post by:
I'm occasionally seeing tracebacks like this: Traceback (most recent call last): File "logging/__init__.py", line 744, in emit File "logging/__init__.py", line 630, in format File "logging/__init__.py", line 421, in format RuntimeError: instance.__dict__ not accessible in restricted mode I'm not sure what it means. Googling leads me to <http://docs.python.org/lib/restricted.htmlbut that says that those
0
8319
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8837
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8512
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7347
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2739
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.