Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
CGIHTTPServer Namespace Reference

Data Structures

class  CGIHTTPRequestHandler
 

Functions

def nobody_uid
 
def executable
 
def test
 

Variables

string __version__ = "0.4"
 
list __all__ = ["CGIHTTPRequestHandler"]
 
 nobody = None
 

Detailed Description

CGI-savvy HTTP Server.

This module builds on SimpleHTTPServer by implementing GET and POST
requests to cgi-bin scripts.

If the os.fork() function is not present (e.g. on Windows),
os.popen2() is used as a fallback, with slightly altered semantics; if
that function is not present either (e.g. on Macintosh), only Python
scripts are supported, and they are executed by the current process.

In all cases, the implementation is intentionally naive -- all
requests are executed sychronously.

SECURITY WARNING: DON'T USE THIS CODE UNLESS YOU ARE INSIDE A FIREWALL
-- it may execute arbitrary Python code or external programs.

Function Documentation

def CGIHTTPServer.executable (   path)
Test for executable file.

Definition at line 305 of file CGIHTTPServer.py.

References test().

306 def executable(path):
307  """Test for executable file."""
308  try:
309  st = os.stat(path)
310  except os.error:
311  return 0
312  return st[0] & 0111 != 0
313 
def CGIHTTPServer.nobody_uid ( )
Internal routine to get nobody's uid

Definition at line 289 of file CGIHTTPServer.py.

References sre_parse.max.

290 def nobody_uid():
291  """Internal routine to get nobody's uid"""
292  global nobody
293  if nobody:
294  return nobody
295  try:
296  import pwd
297  except ImportError:
298  return -1
299  try:
300  nobody = pwd.getpwnam('nobody')[2]
301  except KeyError:
302  nobody = 1 + max(map(lambda x: x[2], pwd.getpwall()))
303  return nobody
304 
def CGIHTTPServer.test (   HandlerClass = CGIHTTPRequestHandler,
  ServerClass = BaseHTTPServer.HTTPServer 
)

Definition at line 315 of file CGIHTTPServer.py.

References SimpleHTTPServer.test().

316  ServerClass = BaseHTTPServer.HTTPServer):
317  SimpleHTTPServer.test(HandlerClass, ServerClass)
318 

Variable Documentation

list __all__ = ["CGIHTTPRequestHandler"]

Definition at line 22 of file CGIHTTPServer.py.

string __version__ = "0.4"

Definition at line 20 of file CGIHTTPServer.py.

nobody = None

Definition at line 287 of file CGIHTTPServer.py.