From 455ecba8a91f1fadd67e87cdcaec596dd3fe04cb Mon Sep 17 00:00:00 2001 From: Eric Allman Date: Mon, 17 Jan 1983 06:07:12 -0800 Subject: [PATCH] fix SHELL command; CR's on end of lines are still a problem, but.... SCCS-vsn: usr.sbin/sendmail/src/srvrsmtp.c 3.44 --- usr/src/usr.sbin/sendmail/src/srvrsmtp.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr/src/usr.sbin/sendmail/src/srvrsmtp.c b/usr/src/usr.sbin/sendmail/src/srvrsmtp.c index 9a41227825..a36991cf0a 100644 --- a/usr/src/usr.sbin/sendmail/src/srvrsmtp.c +++ b/usr/src/usr.sbin/sendmail/src/srvrsmtp.c @@ -2,10 +2,10 @@ # include "sendmail.h" # ifndef SMTP -SCCSID(@(#)srvrsmtp.c 3.43 %G% (no SMTP)); +SCCSID(@(#)srvrsmtp.c 3.44 %G% (no SMTP)); # else SMTP -SCCSID(@(#)srvrsmtp.c 3.43 %G%); +SCCSID(@(#)srvrsmtp.c 3.44 %G%); /* ** SMTP -- run the SMTP protocol. @@ -327,7 +327,8 @@ smtp() { (void) close(0); (void) dup(fileno(InChannel)); - (void) fclose(InChannel); + if (fileno(InChannel) != fileno(OutChannel)) + (void) fclose(InChannel); InChannel = stdin; } if (fileno(OutChannel) != 1) @@ -337,6 +338,8 @@ smtp() (void) fclose(OutChannel); OutChannel = stdout; } + (void) close(2); + (void) dup(1); execl("/bin/csh", "sendmail", 0); execl("/bin/sh", "sendmail", 0); message("500", "Can't"); -- 2.20.1