Speaking of ksh

King Ables ables at hi3.aca.mcc.com.UUCP
Wed Jun 1 00:46:50 AEST 1988


We recently converted a sun server to run YP (like the
rest of the ones in our department) and I was asked to
fix ksh so that ~username would work again (since there
is no significant passwd file on the clients of that
server anymore).  As they were the only ones with ksh,
we hadn't had this problem elsewhere before.

I thought to myself "no big deal... probably just a
recompile so the getpwnam() call works with YP."
WRONG.  Of course, ksh opens the passwd file and reads
it.  OK.  Big deal, I yank that code and I put in a
call to getpwnam() instead... seemed real simple.  But
ever since then I've been getting segmentation faults
down in the bowels of the YP code.  I've grabbed a bunch
of the YP code from our sources and included it so I could
run dbx, and things are fine a LONG way down into it but
a call to malloc() dies eventually.  I actually have things
working to the extent that the first call to getpwnam() works
now but it takes a llloooonnnnngggg time to do it and then
a successive call bombs.  I know my call is ok because I wrote
a short program to run by itself and it works just fine.  If
I load it with the .o files from ksh, things bomb again!

Ksh seems to have its own malloc(), free(), and _filbuf()
which I have renamed everywhere within ksh, but the problem
hasn't gone away.  I was thinking a duplicate entry point
would explain the problem, but I think I've elminiated them.
I now thin something somewhere is overwriting something.

I don't know what version of ksh we have and I will be
contacting our AT&T sales rep to find out whether we are
entitled to a N/C upgrade or we have to buy the newest
version.  I know what we have isn't the LATEST, but on the
other hand, it's perfectly acceptable to the people here and
if it involves more money, I don't know if we'll want to go
for the new version.  And this should be a do-able mod, anyway!
Even if we get a new version that does this, I'm real curious
why things are getting so confused here.

Has anybody "fixed" ksh anywhere to do this?  I can't believe
it can be *THAT* difficult... I must be missing something somewhere
or there must be one or two hard-to-find extra things you have
to do to it to make it work with getpwnam().... any hints?
I'm working on a Sun-3 running SunOS 3.5.

Any previous experience and/or advice anyone would like to
empart would be greatly appreciated.

-king
ARPA: ables at mcc.com
UUCP: {gatech,ihnp4,nbires,seismo,ucb-vax}!ut-sally!im4u!milano!ables



More information about the Comp.unix.wizards mailing list