Changeset 772 for server


Ignore:
Timestamp:
Jun 19, 2008, 3:44:44 PM (14 years ago)
Author:
quentin
Message:
Read whois key from filesystem
File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/common/oursrc/whoisd/whoisd.tac

    r771 r772  
    88    def lineReceived(self, hostname):
    99        (key, hostname) = hostname.split('=',2)
    10         if key != '0xvVk043ZT61jR1bAlX0JSzM':
     10        if key != self.factory.key:
    1111            self.transport.write("Unauthorized to use whois"+"\r\n")
    1212            self.transport.loseConnection()
     
    1919class WhoisFactory(protocol.ServerFactory):
    2020    protocol = WhoisProtocol
    21     def __init__(self, vhostDir, ldap_URL, ldap_base):
     21    def __init__(self, vhostDir, ldap_URL, ldap_base, keyFile):
    2222        self.vhostDir = vhostDir
    2323        self.ldap_URL = ldap_URL
     
    2727        if vhostDir:
    2828            self.rescanVhosts()
     29        self.key = file(keyFile).read()
    2930    def rescanVhosts(self):
    3031        newVhosts = {}
     
    9495application = service.Application('whois', uid=99, gid=99)
    9596factory = WhoisFactory(None,
    96     "ldap://localhost", "ou=VirtualHosts,dc=scripts,dc=mit,dc=edu")
     97    "ldap://localhost", "ou=VirtualHosts,dc=scripts,dc=mit,dc=edu", "/etc/whoisd-password")
    9798internet.TCPServer(43, factory).setServiceParent(
    9899    service.IServiceCollection(application))
Note: See TracChangeset for help on using the changeset viewer.