[Date Prev][Date Next] [Chronological] [Thread] [Top]

libraries/liblutil/passwd.c problem


  I grabbed the latest copy of ldap from the cvs and tried to
compile it on sun solaris 5.7. The compiler complained about
a static function declared/defined within another static function
in libraries/liblutil/passwd.c and also a conflict in des_encrypt
declarations (I am using openssl).

"passwd.c", line 1038: warning: assignment type mismatch:
        pointer to char "=" pointer to uchar
"passwd.c", line 1114: syntax error before or at: {
"passwd.c", line 1117: undefined symbol: key
"passwd.c", line 1117: undefined symbol: lmPasswd

and the code looks like this,

static struct berval *hash_lanman(
        const struct pw_scheme *scheme,
        const struct berval *passwd )
        static void lmPasswd_to_key(const unsigned char *lmPasswd, des_cblock
                /* make room for parity bits */
                ((char *)key)[0] = lmPasswd[0];
                ((char *)key)[1] = ((lmPasswd[0]&0x01)<<7) | (lmPasswd[1]>>1)
                ((char *)key)[2] = ((lmPasswd[1]&0x03)<<6) | (lmPasswd[2]>>2)
                ((char *)key)[3] = ((lmPasswd[2]&0x07)<<5) | (lmPasswd[3]>>3)

  Moving the inner function out solves this problem. As for the other problem,
it has been reported already. So, I just worked around it.