Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!decuac!grebyn!escom!al From: al@escom.com (Al Donaldson) Newsgroups: comp.os.minix Subject: Re: Crypt Message-ID: <1991Jun18.154007.3802@escom.com> Date: 18 Jun 91 15:40:07 GMT References: Organization: ESCOM Corporation Lines: 46 csg020@cck.cov.ac.uk (***CURTIS***) writes: > I now have a new version of crypt.c ... I want to install it > into the library. ... but how do I recompile it? It should be a fairly standard update of a library function. Without seeing the code, I would: - make a copy of the old src/lib/other/crypt.c, just in case - replace the old src/lib/other/crypt.c with the new one - compile the new crypt.c--see the Makefile for flags, etc. - install the new crypt.s in /usr/lib/libc.a--see the man page example for "ar r" for details But that is the easy part. Knuckle-biting time comes when you recompile passwd.c, login.c, and su.c with the new crypt.s and then start playing with the password file. I recommend that you *temporarily* remove the encrypted password for root from your /etc/passwd file. This way, if things go wrong, you can get back in and fix them. (I did this on a system that didn't allow login if the user's password field was empty. Talk about a pucker factor... :-) Now recompile the passwd, login, and su programs using the new library and install them in the appropriate bin directories, with the appropriate modes, setuid bits, and ownership. You might want to rename the old versions (e.g., "mv login login.OLD) beforehand, and then ls -l both the old and new versions to be sure that you have everything the same. Check them again. Next change the password for a general user (e.g., ast) using the new passwd program. Inspect the /etc/passwd file. If it looks OK (exactly 13 bytes in the password field for your user and none of the other users have been hammered), then logout and login again as that user. If you get in this time time, then the chances are everthing works OK and you can go ahead and change all the passwords in the password file, including restoring the root password. If not, well you get some valuable lessons in debugging. :-) Al PS - You did save the old src/lib/other/crypt.c, /usr/lib/libc.a, and /etc/passwd files and the login, su, and passwd binaries, didn't you?