ckpasswd.c trouble

Tomasz Dymek tomek at se.com.pl
Mon Jan 22 11:30:09 UTC 2001



Hello!

I've done some tests of password file auth with inn 2.3.0. I'v some trouble 
with making chpasswd.c work. 
I'm not C programmer and my C skills are low. Mayby You can make this better

ckpasswd.c started to work after following changes.

in GetFilePass() I've added

    if (!(colon = strchr(iter, ':'))) //I think it looks for second colon. Am i right?
        return(0);
    *colon = 0;
    iter++;   // *THIS* w/o this change it returns :<crypted> instead of <crypted>
    strcpy(pass, iter);
    return(pass);
}

and change from:

    if (strcmp(rpass, crypt(pass, rpass)) == 0) {
        printf("user:%s\n", uname);
        exit(0);
    }

to:

    if (strcmp(rpass, crypt(pass, rpass)) == 0) {
        printf("User:%s\n", uname); 	//nnrpd exprects User:<username>
        exit(0);
    }



Please check I'm not replacing old bugs with news ones.



-- 
                                                       * Tomek
(setq disclaimer 'standard e-mail 'tomek.se.com.pl
      pgp-fp "53B8A68AD35A64AF A61DD53E9E5A1C0F")



More information about the inn-bugs mailing list