[alt.sources.d] SysV versions of finger and last, with lastlog.

istvan@hhb.UUCP (Istvan Mohos) (01/02/90)

Thank you very much, Greg A. Woods for posting the source; finally
I was able to figure out why our Ultrix V2.2-1 (source-less) 'finger'
kept dumping core.  One of the gecos fields in /etc/passwd was
    xxyyzzy_mail_only_account

changing 'char buffer[20]' to 'char buffer[BUFSIZ]' in matchcmp()
while certainly an overkill, eliminated the problem once and for all.
Wouldn't it be nice if everybody could agree on a max string size
like 'ANSISTR 512'?

Speaking of ANSI, cpp barfed on '#ident'.  (Is '#ident' ANSI?)  Had to
comment it out to compile.
-- 
        Istvan Mohos
        ...uunet!pyrdc!pyrnj!hhb!istvan
        HHB Systems 1000 Wyckoff Ave. Mahwah NJ 07430 201-848-8000
====================================================================

woods@robohack.UUCP (Greg A. Woods) (01/03/90)

In article <300@hhb.UUCP> istvan@hhb.UUCP (Istvan Mohos) writes:
> Speaking of ANSI, cpp barfed on '#ident'.  (Is '#ident' ANSI?)  Had to
> comment it out to compile.

Hmm... I thought I'd been quite careful about the '#ident's.  They
should only be seen if you have SYSVR3 defined.  It was with SysVr3.0
(as far as I can tell) that AT&T introduced the '#ident' pragma for
entring .comment sections in the assembler output.  There is no other
need to define SYSVR3 in the finger.c I posted.

As for buffers and such, I didn't do too much cleanup.  There are
still a lot of "magic numbers" scattered about, some of which place
restrictions on data, others which define data, etc.  It's not dumped
on me yet :-), though I'll change those buffer declarations which deal
with user data as you've suggested.
-- 
						Greg A. Woods

woods@{robohack,gate,tmsoft,ontmoh,utgpu,gpu.utcs.Toronto.EDU,utorgpu.BITNET}
+1 416 443-1734 [h]   +1 416 595-5425 [w]   VE3-TCP   Toronto, Ontario; CANADA