Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!hp4nl!phigate!prle!prles2!cstw01!meulenbr
From: meulenbr@cstw01.prl.philips.nl (Frans Meulenbroeks)
Newsgroups: comp.os.minix
Subject: crypt(3) problems
Message-ID: <721@prles2.UUCP>
Date: 28 Sep 89 13:07:53 GMT
Sender: nobody@prles2.UUCP
Reply-To: meulenbr@cst.prl.philips.nl ()
Organization: Centre for Software Technology, Philips Eindhoven
Lines: 29

Hi!

When looking at crypt(3) I noticed a few problems:
1) crypt has been changed during the traverse from PC 1.2 to PC 1.3
   Since I don't think both crypts are equivalent this implies that
   if you upgrade and rebuild init the original passwd file will
   not work any more.
2) The new crypt contains a bug
   Some code fragments:
	...
        register char bits[67];
	...
        for (i=0; i < 12; i++) {
                buf[i+2] = 0;
                for (j=0; j < 6; j++)
                        buf[i+2] |= (bits[i*6+j] ? (1 << j) : 0);
	...
	
   Since i can grow to 11 and j to 5 the expression i*6+j can be as
   large as 71 exceeding the maximum allowed value of 66

Since the code of crypt is quite cryptic, and because the lack of
comments in the code, I've no idea how to fix this. Any suggestion
is welcome.

Regards,
Frans Meulenbroeks        (meulenbr@cst.prl.philips.nl)
	Centre for Software Technology
	( or try: ...!mcvax!phigate!prle!cst!meulenbr)