[comp.unix.ultrix] 'f' dumping core

dubois@rhesus.UUCP (Paul DuBois) (10/06/87)

I posted a message recently about 'f' dumping core occasionally, and
then fixing itself later.  Thanks to Gordon Vickers for the clue to
the fix.  The GECOS field of the passwd entry can be corrupted in such
a way that f bombs.  In my case, one of the subfields was a couple of
characters too long.  Shortening it fixed everything up.

So, presumably the momemtary core dumping occurred while the user
with that login was on the system, and desisted when he logged out.

---
Paul DuBois     UUCP: {allegra,ihnp4,seismo}!uwvax!rhesus!dubois    |
                ARPA: dubois@rhesus.primate.wisc.edu              --+--
                                                                    |
"Suffering is the finger exercising of the spirit." - Mr. Theo      |

jsdy@hadron.UUCP (Joseph S. D. Yao) (10/08/87)

This is a correction, if my previous note has already reached you.

If you have binaries only, you must use the -m flag or trim your GECOS
fields to 19 characters before the first ',' or terminating ':'.

I aliased 'f' to be '/usr/ucb/finger -m' until I got fed up and went
and fixed the source.

In source, in routine matchcmp(), I expanded buffer[] from 20 to 64
(to accomodate some large-named users), and changed the line:
		while ( unfound ) {
to
		while (unfound && i < sizeof(buffer) - 1) {

Folks, when filling a buffer, I can't emphasize enough the importance
of checking for end conditions like that.  Your assumptions are almost
always proven wrong by reality.  (Well, mine are, and this program's
author's were.)

	Joe Yao		jsdy@hadron.COM (not yet domainised)
	hadron!jsdy@{uunet.UU.NET,dtix.ARPA,decuac.DEC.COM}
	att,blkcat,cos,decuac,dtix,ecogong,phw5,\
	inco,insight,itc3b2,kcwc,netex,netxcom,  >!hadron!jsdy
	empire,rlgvax,seismo,smsdpg,sundc,uunet /