[comp.mail.sendmail] sendmail 5.61 dumps core writing to SmtpOut

pst@nessus.UUCP (Paul Traina) (03/03/89)

I've got a MacII w/A/UX at work, and I'm having problems installing
sendmail 5.61 on it.

I'm running with the nameserver stuff turned on.  Everything work just
fine until final IPC delivery.  My sendmail opens a channel to the remote
system,  I see on the screen the system respond with its id, and when my
machine attempts to send the "HELO" message out, it dumps core in the
fprintf routine in the smtpmessage() routine (usersmtp line 501).

I've compiled it with -DVMUNIX, and added a few minor changes that were
needed to run under A/UX (changed load average handling, etc.).  I've tried
turning on all BSD compatibility flags using the unisoft setcompat() call,
and I've also turned on 4.2 signals manually with set42sig() under the
unisoft "dual-os" mode.

I'm stuck.  Is it a sendmail bug?  Is it an A/UX bug?  Has anyone compiled
any verson of sendmail to run under A/UX?  It looks like it's opening the
output stream correctly,  it obviously handled the input stream properly,
since I received the ident message from the remote system.

Any help (especially diffs from any version of sendmail to make it work
under A/UX) would be appreciated.

Thanks,
    Paul

-- 
== pst%nessus@hub.ucsb.edu  ...pyramid!ucsbcsl!nessus!pst  pst@ai.ai.mit.edu ==

What can you say about chocolate covered manhole covers?

pst@nessus.UUCP (Paul Traina) (03/04/89)

Thanks to the people that responded, especially Steve Alexander @ Lachman.

There are two ways to fix it, I'll present Steve's, since it's more elgant
than mine.  In the routine makeconnection() in daemon.c, the socket is
open & connected, then two fdopen's are made on the same socket.

System V has a bug in stdio, so this won't work right.  The two solutions
are either (a) open it once for reads & writes, and then do rewinds
between reads & writes (ugly), or Steve's solution, just dup() the socket.
(I didn't think that would work, so I never tried it).

Old code:
	*outfile = fdopen(s, "w");
	*infile = fdopen(s, "r");

New code:
	*outfile = fdopen(dup(s), "w");
	*infile = fdopen(s, "r");

I've tried it out, and it seems to run like a champ (so far :-) ).

Hope this helps someone else.  The rest of the 5.61 conversion is
trivial.  If anyone wants diffs off the 5.61 distribution for System5
w/Berkeley networking (at least Unisoft's),  drop me a note.

Paul
-- 
== pst%nessus@hub.ucsb.edu  ...pyramid!ucsbcsl!nessus!pst  pst@ai.ai.mit.edu ==

What can you say about chocolate covered manhole covers?