473,405 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Modifying the Python interpreter to create a custom secure version

Hey everyone,

I'm embedding the Python interpreter within my program to use as a
scripting language. However, one of the unique features of our program is
the ability of the internal language to possess per-object security
permissions and restricted execution.

Therefore, we need to add extra "magic members" (a la __class__, __doc__,
and friends) to *all* objects in Python. By editing PyClass_New, we
managed to add a test member to all old-style classes. Furthermore, by
editing type_new, we managed to achieve the same results for all user-
made new-style classes.

However! This didn't do anything for built-in types, such as int, object,
etc.

What are we doing wrong, and does anyone have any
recommendations/experience in modifying the built-in interpreter. The
source code is clear but a bit daunting when it comes to finding -
exactly- where to place code like this. If we're implementing things too
far down the type hierarchy, it would be nice to know this beforehand so
we don't duplicate any code.

Thanks in advance for all your help.

Alex, Lucas
Comp. Engineering
University of Waterloo
Jul 18 '05 #1
0 1156

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

Similar topics

12
by: Tony Belding | last post by:
I'm interested in using an off-the-shelf interpreted language as a user-accessible scripting language for a MUCK. I'm just not sure if I can find one that does everything I need. The MUCK must be...
5
by: Adam Atlas | last post by:
Does anyone know if it would be possible to create a CPython extension -- or use the ctypes module -- to access Python's own embedding API (http://docs.python.org/api/initialization.html &c.)?...
3
by: Derek Martin | last post by:
On Wed, Aug 20, 2008 at 03:19:19PM -0400, joey boggs wrote: What is the problem you are trying to solve? Are you asking how to write a shell in Python? <pet peeve> You wouldn't... "setup"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.