summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-07-16 14:47:32 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-07-16 14:47:32 +0000
commit3a0746f02ab0c6a1a7131d5d393402e088bd7b44 (patch)
tree9259a6954c51cc56a7994cd8825248f34d984fc3 /bin
parentaaa1c5d63dd91d25108cd15fcb50f7b5d578fa3b (diff)
Neuter the fc builtin on non-interactive shells; inspired by NetBSD PR#26339.
ok millert@
Diffstat (limited to 'bin')
-rw-r--r--bin/ksh/history.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/ksh/history.c b/bin/ksh/history.c
index a3737c41c23..62a06bc62bb 100644
--- a/bin/ksh/history.c
+++ b/bin/ksh/history.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: history.c,v 1.22 2003/05/18 01:02:42 jsyn Exp $ */
+/* $OpenBSD: history.c,v 1.23 2004/07/16 14:47:31 miod Exp $ */
/*
* command history
@@ -86,6 +86,11 @@ c_fc(wp)
char *first = (char *) 0, *last = (char *) 0;
char **hfirst, **hlast, **hp;
+ if (!Flag(FTALKING)) {
+ bi_errorf("history functions not available");
+ return 1;
+ }
+
while ((optc = ksh_getopt(wp, &builtin_opt, "e:glnrs0,1,2,3,4,5,6,7,8,9,")) != EOF)
switch (optc) {
case 'e':