Hackfut Security File Manager
Current Path:
/usr/lib/python2.6/site-packages/supervisor/medusa
usr
/
lib
/
python2.6
/
site-packages
/
supervisor
/
medusa
/
📁
..
📄
__init__.py
(128 B)
📄
__init__.pyc
(277 B)
📄
__init__.pyo
(277 B)
📄
auth_handler.py
(4.63 KB)
📄
auth_handler.pyc
(4.41 KB)
📄
auth_handler.pyo
(4.41 KB)
📄
chat_server.py
(4.43 KB)
📄
chat_server.pyc
(6.28 KB)
📄
chat_server.pyo
(6.28 KB)
📄
counter.py
(1.41 KB)
📄
counter.pyc
(1.99 KB)
📄
counter.pyo
(1.99 KB)
📄
default_handler.py
(6.18 KB)
📄
default_handler.pyc
(4.92 KB)
📄
default_handler.pyo
(4.92 KB)
📄
event_loop.py
(2.91 KB)
📄
event_loop.pyc
(3.43 KB)
📄
event_loop.pyo
(3.43 KB)
📄
filesys.py
(10.94 KB)
📄
filesys.pyc
(13.28 KB)
📄
filesys.pyo
(13.28 KB)
📄
ftp_server.py
(39.6 KB)
📄
ftp_server.pyc
(33.91 KB)
📄
ftp_server.pyo
(33.91 KB)
📄
http_date.py
(3.33 KB)
📄
http_date.pyc
(3.39 KB)
📄
http_date.pyo
(3.39 KB)
📄
http_server.py
(24.63 KB)
📄
http_server.pyc
(20.96 KB)
📄
http_server.pyo
(20.96 KB)
📄
logger.py
(7.81 KB)
📄
logger.pyc
(10.73 KB)
📄
logger.pyo
(10.73 KB)
📄
m_syslog.py
(7.18 KB)
📄
m_syslog.pyc
(3.91 KB)
📄
m_syslog.pyo
(3.91 KB)
📄
medusa_gif.py
(2.71 KB)
📄
medusa_gif.pyc
(1.13 KB)
📄
medusa_gif.pyo
(1.13 KB)
📄
monitor.py
(10.79 KB)
📄
monitor.pyc
(12 KB)
📄
monitor.pyo
(12 KB)
📄
monitor_client.py
(3.2 KB)
📄
monitor_client.pyc
(5.26 KB)
📄
monitor_client.pyo
(5.26 KB)
📄
monitor_client_win32.py
(1.3 KB)
📄
monitor_client_win32.pyc
(2.04 KB)
📄
monitor_client_win32.pyo
(2.04 KB)
📄
producers.py
(9.22 KB)
📄
producers.pyc
(11.36 KB)
📄
producers.pyo
(11.36 KB)
📄
put_handler.py
(3.25 KB)
📄
put_handler.pyc
(3.43 KB)
📄
put_handler.pyo
(3.43 KB)
📄
redirecting_handler.py
(1.37 KB)
📄
redirecting_handler.pyc
(2.11 KB)
📄
redirecting_handler.pyo
(2.11 KB)
📄
resolver.py
(15.19 KB)
📄
resolver.pyc
(12.11 KB)
📄
resolver.pyo
(12.11 KB)
📄
rpc_client.py
(9.45 KB)
📄
rpc_client.pyc
(10.1 KB)
📄
rpc_client.pyo
(10.1 KB)
📄
rpc_server.py
(9.72 KB)
📄
rpc_server.pyc
(9.31 KB)
📄
rpc_server.pyo
(9.31 KB)
📄
script_handler.py
(6.4 KB)
📄
script_handler.pyc
(6.5 KB)
📄
script_handler.pyo
(6.5 KB)
📄
setup.py
(496 B)
📄
setup.pyc
(729 B)
📄
setup.pyo
(729 B)
📄
status_handler.py
(9.13 KB)
📄
status_handler.pyc
(9.45 KB)
📄
status_handler.pyo
(9.45 KB)
📄
unix_user_handler.py
(2.26 KB)
📄
unix_user_handler.pyc
(2.31 KB)
📄
unix_user_handler.pyo
(2.31 KB)
📄
virtual_handler.py
(1.68 KB)
📄
virtual_handler.pyc
(3.09 KB)
📄
virtual_handler.pyo
(3.09 KB)
📄
xmlrpc_handler.py
(2.88 KB)
📄
xmlrpc_handler.pyc
(3.7 KB)
📄
xmlrpc_handler.pyo
(3.7 KB)
Editing: put_handler.py
# -*- Mode: Python -*- # # Author: Sam Rushing <rushing@nightmare.com> # Copyright 1996-2000 by Sam Rushing # All Rights Reserved. # RCS_ID = '$Id: put_handler.py,v 1.1.1.1 2006/06/26 06:36:05 chrism Exp $' import re import string import default_handler unquote = default_handler.unquote get_header = default_handler.get_header last_request = None class put_handler: def __init__ (self, filesystem, uri_regex): self.filesystem = filesystem if type (uri_regex) == type(''): self.uri_regex = re.compile (uri_regex) else: self.uri_regex = uri_regex def match (self, request): uri = request.uri if request.command == 'PUT': m = self.uri_regex.match (uri) if m and m.end() == len(uri): return 1 return 0 def handle_request (self, request): path, params, query, fragment = request.split_uri() # strip off leading slashes while path and path[0] == '/': path = path[1:] if '%' in path: path = unquote (path) # make sure there's a content-length header cl = get_header (CONTENT_LENGTH, request.header) if not cl: request.error (411) return else: cl = string.atoi (cl) # don't let the try to overwrite a directory if self.filesystem.isdir (path): request.error (405) return is_update = self.filesystem.isfile (path) try: output_file = self.filesystem.open (path, 'wb') except: request.error (405) return request.collector = put_collector (output_file, cl, request, is_update) # no terminator while receiving PUT data request.channel.set_terminator (None) # don't respond yet, wait until we've received the data... class put_collector: def __init__ (self, file, length, request, is_update): self.file = file self.length = length self.request = request self.is_update = is_update self.bytes_in = 0 def collect_incoming_data (self, data): ld = len(data) bi = self.bytes_in if (bi + ld) >= self.length: # last bit of data chunk = self.length - bi self.file.write (data[:chunk]) self.file.close() if chunk != ld: print 'orphaned %d bytes: <%s>' % (ld - chunk, repr(data[chunk:])) # do some housekeeping r = self.request ch = r.channel ch.current_request = None # set the terminator back to the default ch.set_terminator ('\r\n\r\n') if self.is_update: r.reply_code = 204 # No content r.done() else: r.reply_now (201) # Created # avoid circular reference del self.request else: self.file.write (data) self.bytes_in = self.bytes_in + ld def found_terminator (self): # shouldn't be called pass CONTENT_LENGTH = re.compile ('Content-Length: ([0-9]+)', re.IGNORECASE)
Upload File
Create Folder