[Zope-dev] Z2.py is dying...

Fabio Augusto Mazzarino mazza@radiumsystems.com.br
Thu, 13 Apr 2000 15:09:42 -0300


 Hello folks.

 After some weeks of hard work trying to install nisUserFolder I discoverd
that we use md5 password encryptation. Then, after some hours I've modified
this way:
from this:
    def authenticate(self, password, request):
        domains=self.getDomains()
        person = match(self.name,'passwd.byname')
        vals = split(person, ':')
        if vals[1][-1] == '\n':                 #name:pwd\n
                pwd = vals[1][:-1]
        else:
                pwd = vals[1]                   #normal way
        salt = vals[1][:2]                     #ye old nisUserFolder w/o md5
        secret = crypt(password, salt)
        if domains:
            return (secret==pwd) and domainSpecMatch(domains, request)
        return secret==pwd

to this:
    def authenticate(self, password, request):
        domains=self.getDomains()
        person = match(self.name,'passwd.byname')
        vals = split(person, ':')
        if vals[1][-1] == '\n':                 #name:pwd\n
                pwd = vals[1][:-1]
        else:
                pwd = vals[1]                   #normal way

        if vals[1][:3] == '$1$':                #md5 way
                delim = find(vals[1], '$', 3)
                salt = vals[1][:delim]          #$1$salt
        else:
                salt = vals[1][:2]              #ye old nisUserFolder w/o
md5
        #salt = vals[1][:2]                     #ye old nisUserFolder w/o
md5

        secret = crypt(password, salt)
        if domains:
            return (secret==pwd) and domainSpecMatch(domains, request)
        return secret==pwd

 And now Z2.py lasts no more than 5 minutes. It simply dies without any
warning, without any message at all.

 What can I do to validate these users *and* make Zope work correctly (yes,
it used to work before nisUserFolder modification).

 Thanx.

 Fabio Augusto Mazzarino - mazza@radiumsystems.com.br

P.S.: What is past tense for to ping?