diff options
author | 2001-11-23 00:03:24 +0000 | |
---|---|---|
committer | 2001-11-23 00:03:24 +0000 | |
commit | 871e3f251f75a1a2360aa4dc2a036923b3d18f14 (patch) | |
tree | 0c4bbc2b22e0979399e7234d90712b2257bc6d9a | |
parent | Remove broken interrupt handler. (diff) | |
download | wireguard-openbsd-871e3f251f75a1a2360aa4dc2a036923b3d18f14.tar.xz wireguard-openbsd-871e3f251f75a1a2360aa4dc2a036923b3d18f14.zip |
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.
-rw-r--r-- | usr.bin/mail/popen.c | 14 |
1 files changed, 3 insertions, 11 deletions
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) { |