summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-05-13 06:54:59 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-05-13 06:54:59 +0000
commit763973eaa8f9842f3ee719cf88f1d008d209f0d8 (patch)
tree33657a19e383a90f9eb1b0f9bec6b13326e715db
parenta56aea2f9e71fda45707a3933256c8c58ce90bd5 (diff)
catch more commands that require a shell
-rw-r--r--usr.bin/make/compat.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c
index 58ca92458a1..52811c83222 100644
--- a/usr.bin/make/compat.c
+++ b/usr.bin/make/compat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: compat.c,v 1.10 1998/05/12 07:10:01 deraadt Exp $ */
+/* $OpenBSD: compat.c,v 1.11 1998/05/13 06:54:58 deraadt Exp $ */
/* $NetBSD: compat.c,v 1.14 1996/11/06 17:59:01 christos Exp $ */
/*
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94";
#else
-static char rcsid[] = "$OpenBSD: compat.c,v 1.10 1998/05/12 07:10:01 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: compat.c,v 1.11 1998/05/13 06:54:58 deraadt Exp $";
#endif
#endif /* not lint */
@@ -150,12 +150,21 @@ static int
shellneed (cmd)
char *cmd;
{
- char **av;
+ char *runsh[] = {
+ "alias", "cd", "eval", "exec", "exit", "read", "set", "ulimit",
+ "unalias", "unset", "wait", ":",
+ NULL
+ };
+
+ char **av, **p;
int ac;
av = brk_string(cmd, &ac, TRUE);
- if (strcmp(av[1], "exit") == 0)
- return (1);
+
+ for (p = runsh; *p; p++)
+ if (strcmp(av[1], *p) == 0)
+ return (1);
+
if (strcmp(av[1], "umask") == 0) {
long umi;
char *ep = NULL;