Ignore:
Timestamp:
Jun 19, 2008, 3:40:31 PM (14 years ago)
Author:
quentin
Message:
Commit local changes from b-m to whoisd
File:
1 edited

Legend:

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

    r762 r771  
    77class WhoisProtocol(basic.LineReceiver):
    88    def lineReceived(self, hostname):
    9         self.factory.getWhois(hostname
    10         ).addErrback(lambda _: "Internal error in server"
    11         ).addCallback(lambda m:
    12                       (self.transport.write(m+"\r\n"),
    13                        self.transport.loseConnection()))
     9        (key, hostname) = hostname.split('=',2)
     10        if key != '0xvVk043ZT61jR1bAlX0JSzM':
     11            self.transport.write("Unauthorized to use whois"+"\r\n")
     12            self.transport.loseConnection()
     13        else:
     14            self.factory.getWhois(hostname
     15            ).addErrback(lambda _: "Internal error in server"
     16            ).addCallback(lambda m:
     17                          (self.transport.write(m+"\r\n"),
     18                           self.transport.loseConnection()))
    1419class WhoisFactory(protocol.ServerFactory):
    1520    protocol = WhoisProtocol
     
    6974            user = pwd.getpwuid(int(attrs['apacheSuexecUid']))
    7075            if user:
    71                 attrs['locker'] = user.pw_namep
     76                attrs['locker'] = user.pw_name
    7277            else:
    7378                attrs['locker'] = None
Note: See TracChangeset for help on using the changeset viewer.