ckpasswd.c trouble

Russ Allbery rra at stanford.edu
Tue Jan 23 00:30:01 UTC 2001



Tomasz Dymek <tomek at se.com.pl> writes:

> 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

I'm not sure what you're running into; I don't think either of these could
have been the problem.  Perhaps you were running into the fact that the
2.3.0 ckpasswd program was pretty picky about file format?  2.3.1 is a bit
more relaxed in that department.

> 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?

Right.

>         return(0);
>     *colon = 0;
>     iter++;   // *THIS* w/o this change it returns :<crypted> instead of <crypted>

iter is set above to colon + 1, at least in STABLE.

>     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);
>     }

STABLE already had that change, but I've also now made nnrpd
case-insensitive.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>



More information about the inn-bugs mailing list