summaryrefslogtreecommitdiff
path: root/bin/ksh/c_ulimit.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-01-17 19:00:45 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-01-17 19:00:45 +0000
commitca091f8038b0ce14749ada5c80eb7f63cfc4f3af (patch)
tree87b5787f0c6e8e7032a27d6745ece29312669b41 /bin/ksh/c_ulimit.c
parentdf0bb53507273eb17a8bccb492231ba07b4b29bf (diff)
Make ulimit catch bogosity so that: "ulimit -dflmnpst unlimitted"
Results in: ksh: ulimit: "unlimitted" is not a valid limit Not: Killed (because it treated the word as 0). Noticed by mickey@openbsd.org
Diffstat (limited to 'bin/ksh/c_ulimit.c')
-rw-r--r--bin/ksh/c_ulimit.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/ksh/c_ulimit.c b/bin/ksh/c_ulimit.c
index b96c10bf5b8..deb26986fc8 100644
--- a/bin/ksh/c_ulimit.c
+++ b/bin/ksh/c_ulimit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: c_ulimit.c,v 1.3 1997/06/19 13:58:39 kstailey Exp $ */
+/* $OpenBSD: c_ulimit.c,v 1.4 1998/01/17 19:00:44 millert Exp $ */
/*
ulimit -- handle "ulimit" builtin
@@ -167,7 +167,10 @@ c_ulimit(wp)
val = RLIM_INFINITY;
else
#endif /* RLIM_INFINITY */
- {
+ if (!isdigit(*p)) {
+ bi_errorf("\"%s\" is not a valid limit", p);
+ return 1;
+ } else {
long rval;
if (!evaluate(p, &rval, TRUE))