From ab5d84bd1592b6cf30096d65389436c3949bc292 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 23 Nov 2001 00:03:25 +0000 Subject: Revert change to Popen() to only wrap command in a shell if it contains meta characters since people may expect their aliases to work. Instead, just remove the "kill(lock_pid, SIGTERM);" since lockspool now does the right thing when the pipe is closed. --- usr.bin/mail/popen.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'usr.bin/mail') diff --git a/usr.bin/mail/popen.c b/usr.bin/mail/popen.c index 30ab4d9dedb..7932f1e9180 100644 --- a/usr.bin/mail/popen.c +++ b/usr.bin/mail/popen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: popen.c,v 1.30 2001/11/21 20:41:55 millert Exp $ */ +/* $OpenBSD: popen.c,v 1.31 2001/11/23 00:03:24 millert Exp $ */ /* $NetBSD: popen.c,v 1.6 1997/05/13 06:48:42 mikel Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static const char sccsid[] = "@(#)popen.c 8.1 (Berkeley) 6/6/93"; #else -static const char rcsid[] = "$OpenBSD: popen.c,v 1.30 2001/11/21 20:41:55 millert Exp $"; +static const char rcsid[] = "$OpenBSD: popen.c,v 1.31 2001/11/23 00:03:24 millert Exp $"; #endif #endif /* not lint */ @@ -128,14 +128,7 @@ Popen(char *cmd, char *mode) fd1 = -1; } sigemptyset(&nset); - /* - * If cmd contains meta chars wrap it in a shell. - */ - if (strpbrk(cmd, "$&*(){}[]'\";\\|?<>~`")) - pid = start_command(value("SHELL"), &nset, fd0, fd1, - "-c", cmd, NULL); - else - pid = start_command(cmd, &nset, fd0, fd1, NULL); + pid = start_command(value("SHELL"), &nset, fd0, fd1, "-c", cmd, NULL); if (pid < 0) { (void)close(p[READ]); (void)close(p[WRITE]); @@ -450,7 +443,6 @@ handle_spool_locks(int action) stderr); return(-1); } - (void)kill(lock_pid, SIGTERM); (void)Pclose(lockfp); lockfp = NULL; } else if (action == 1) { -- cgit v1.2.3