/usr/lib/python2.6/site-packages/supervisor/medusa
NameSizeModeActions
auth_handler.py47390644editdlrm
auth_handler.pyc45130644editdlrm
auth_handler.pyo45130644editdlrm
chat_server.py45350644editdlrm
chat_server.pyc64270644editdlrm
chat_server.pyo64270644editdlrm
counter.py14400644editdlrm
counter.pyc20390644editdlrm
counter.pyo20390644editdlrm
default_handler.py63310644editdlrm
default_handler.pyc50340644editdlrm
default_handler.pyo50340644editdlrm
event_loop.py29810644editdlrm
event_loop.pyc35130644editdlrm
event_loop.pyo35130644editdlrm
filesys.py112060644editdlrm
filesys.pyc135980644editdlrm
filesys.pyo135980644editdlrm
ftp_server.py405520644editdlrm
ftp_server.pyc347270644editdlrm
ftp_server.pyo347270644editdlrm
http_date.py34150644editdlrm
http_date.pyc34680644editdlrm
http_date.pyo34680644editdlrm
http_server.py252170644editdlrm
http_server.pyc214680644editdlrm
http_server.pyo214680644editdlrm
logger.py80000644editdlrm
logger.pyc109900644editdlrm
logger.pyo109900644editdlrm
medusa_gif.py27720644editdlrm
medusa_gif.pyc11560644editdlrm
medusa_gif.pyo11560644editdlrm
monitor.py110540644editdlrm
monitor.pyc122850644editdlrm
monitor.pyo122850644editdlrm
monitor_client.py32730644editdlrm
monitor_client.pyc53900644editdlrm
monitor_client.pyo53900644editdlrm
monitor_client_win32.py13340644editdlrm
monitor_client_win32.pyc20940644editdlrm
monitor_client_win32.pyo20940644editdlrm
m_syslog.py73510644editdlrm
m_syslog.pyc40060644editdlrm
m_syslog.pyo40060644editdlrm
producers.py94390644editdlrm
producers.pyc116340644editdlrm
producers.pyo116340644editdlrm
put_handler.py33240644editdlrm
put_handler.pyc35110644editdlrm
put_handler.pyo35110644editdlrm
redirecting_handler.py14030644editdlrm
redirecting_handler.pyc21590644editdlrm
redirecting_handler.pyo21590644editdlrm
resolver.py155590644editdlrm
resolver.pyc124010644editdlrm
resolver.pyo124010644editdlrm
rpc_client.py96750644editdlrm
rpc_client.pyc103460644editdlrm
rpc_client.pyo103460644editdlrm
rpc_server.py99530644editdlrm
rpc_server.pyc95360644editdlrm
rpc_server.pyo95360644editdlrm
script_handler.py65540644editdlrm
script_handler.pyc66510644editdlrm
script_handler.pyo66510644editdlrm
setup.py4960644editdlrm
setup.pyc7290644editdlrm
setup.pyo7290644editdlrm
status_handler.py93520644editdlrm
status_handler.pyc96720644editdlrm
status_handler.pyo96720644editdlrm
unix_user_handler.py23120644editdlrm
unix_user_handler.pyc23610644editdlrm
unix_user_handler.pyo23610644editdlrm
virtual_handler.py17240644editdlrm
virtual_handler.pyc31640644editdlrm
virtual_handler.pyo31640644editdlrm
xmlrpc_handler.py29440644editdlrm
xmlrpc_handler.pyc37840644editdlrm
xmlrpc_handler.pyo37840644editdlrm
__init__.py1280644editdlrm
__init__.pyc2770644editdlrm
__init__.pyo2770644editdlrm
Edit: /usr/lib/python2.6/site-packages/supervisor/medusa/monitor_client.py (3273B)
# -*- Mode: Python -*- # monitor client, unix version. import asyncore import asynchat import socket import string import sys import os import md5 class stdin_channel (asyncore.file_dispatcher): def handle_read (self): data = self.recv(512) if not data: print '\nclosed.' self.sock_channel.close() try: self.close() except: pass data = string.replace(data, '\n', '\r\n') self.sock_channel.push (data) def writable (self): return 0 def log (self, *ignore): pass class monitor_client (asynchat.async_chat): def __init__ (self, password, addr=('',8023), socket_type=socket.AF_INET): asynchat.async_chat.__init__ (self) self.create_socket (socket_type, socket.SOCK_STREAM) self.terminator = '\r\n' self.connect (addr) self.sent_auth = 0 self.timestamp = '' self.password = password def collect_incoming_data (self, data): if not self.sent_auth: self.timestamp = self.timestamp + data else: sys.stdout.write (data) sys.stdout.flush() def found_terminator (self): if not self.sent_auth: self.push (hex_digest (self.timestamp + self.password) + '\r\n') self.sent_auth = 1 else: print def handle_close (self): # close all the channels, which will make the standard main # loop exit. map (lambda x: x.close(), asyncore.socket_map.values()) def log (self, *ignore): pass class encrypted_monitor_client (monitor_client): "Wrap push() and recv() with a stream cipher" def init_cipher (self, cipher, key): self.outgoing = cipher.new (key) self.incoming = cipher.new (key) def push (self, data): # push the encrypted data instead return monitor_client.push (self, self.outgoing.encrypt (data)) def recv (self, block_size): data = monitor_client.recv (self, block_size) if data: return self.incoming.decrypt (data) else: return data def hex_digest (s): m = md5.md5() m.update (s) return string.join ( map (lambda x: hex (ord (x))[2:], map (None, m.digest())), '', ) if __name__ == '__main__': if len(sys.argv) == 1: print 'Usage: %s host port' % sys.argv[0] sys.exit(0) if ('-e' in sys.argv): encrypt = 1 sys.argv.remove ('-e') else: encrypt = 0 sys.stderr.write ('Enter Password: ') sys.stderr.flush() try: os.system ('stty -echo') p = raw_input() print finally: os.system ('stty echo') stdin = stdin_channel (0) if len(sys.argv) > 1: if encrypt: client = encrypted_monitor_client (p, (sys.argv[1], string.atoi (sys.argv[2]))) import sapphire client.init_cipher (sapphire, p) else: client = monitor_client (p, (sys.argv[1], string.atoi (sys.argv[2]))) else: # default to local host, 'standard' port client = monitor_client (p) stdin.sock_channel = client asyncore.loop()