472,804 Members | 1,241 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

python without while and other "explosive" statements

Hello,

Is it possible to have a python which not handle the execution of
"while", "for", and other loop statements ? I would like to allow
remote execution of python on a public irc channel, so i'm looking for
techniques which would do so people won't be able to crash my computer
(while 1: os.fork(1)), or at least won't won't freeze my python in a
infinite loop, make it unresponsive. Is there a compiling option (or
better, something i can get with apt-get cos i think compiling myself
and handle all the metastuff myself is somehow dirty) for have a
"secure python" (you can guess what i mean by "secure" in my case) or
must i touch myself the source disable some code lines ? If last
solution, which modifications in which files should i do ? (sorry for
my bad english)

Thanks.

Ivo
Jun 27 '08 #1
1 946
On 2008-05-11, ivo talvet <iv********@gmail.comwrote:
Is it possible to have a python which not handle the execution of
"while", "for", and other loop statements ? I would like to allow
remote execution of python on a public irc channel, so i'm looking for
techniques which would do so people won't be able to crash my computer
(while 1: os.fork(1)), or at least won't won't freeze my python in a
infinite loop, make it unresponsive.
The easiest thing to to is to limit the amount of files,
disk-space, file descriptors, inodes, memory, cpu, and
processes that the users are allowed. If bash is your shell,
the builtin "ulimit" provides most of those features. The file
system quota features provide the rest.
Is there a compiling option (or better, something i can get
with apt-get cos i think compiling myself and handle all the
metastuff myself is somehow dirty) for have a "secure python"
(you can guess what i mean by "secure" in my case) or must i
touch myself the source disable some code lines ? If last
solution, which modifications in which files should i do?
My advice is don't try to secure Python itself: secure the
environment in which the users are using it.

--
Grant Edwards grante Yow! Did I SELL OUT yet??
at
visi.com
Jun 27 '08 #2

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

Similar topics

0
by: Matt Nordhoff | last post by:
ivo talvet wrote: <http://codepad.org/is a pastebin-like website that lets people upload code in a dozen different languages, and it runs it. They have info up about how it's secure at...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.