diff options
author | Mike Pechkin <mpech@cvs.openbsd.org> | 2002-01-25 06:40:15 +0000 |
---|---|---|
committer | Mike Pechkin <mpech@cvs.openbsd.org> | 2002-01-25 06:40:15 +0000 |
commit | 7bd65b71f253b2c681111547dfc0d96f30083e7f (patch) | |
tree | 7f064802f798ee75662d6470a1ebb5aeb16c3d59 /libexec/ftpd/ftpcmd.y | |
parent | 9f562b5bb101bea6319f1c5395cd699cf75377f5 (diff) |
Catch not valid chmod value earlier. This make sense, before we didn't
handle some situations and pass value to chmod() instead of fatal.
Idea stolen from `SITE UMASK` handler.
millert@ ok
Diffstat (limited to 'libexec/ftpd/ftpcmd.y')
-rw-r--r-- | libexec/ftpd/ftpcmd.y | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y index 4de095bc0a5..2d0ed4e460e 100644 --- a/libexec/ftpd/ftpcmd.y +++ b/libexec/ftpd/ftpcmd.y @@ -1,4 +1,4 @@ -/* $OpenBSD: ftpcmd.y,v 1.33 2002/01/23 16:38:12 mpech Exp $ */ +/* $OpenBSD: ftpcmd.y,v 1.34 2002/01/25 06:40:14 mpech Exp $ */ /* $NetBSD: ftpcmd.y,v 1.7 1996/04/08 19:03:11 jtc Exp $ */ /* @@ -47,7 +47,7 @@ #if 0 static char sccsid[] = "@(#)ftpcmd.y 8.3 (Berkeley) 4/6/94"; #else -static char rcsid[] = "$OpenBSD: ftpcmd.y,v 1.33 2002/01/23 16:38:12 mpech Exp $"; +static char rcsid[] = "$OpenBSD: ftpcmd.y,v 1.34 2002/01/25 06:40:14 mpech Exp $"; #endif #endif /* not lint */ @@ -527,7 +527,7 @@ cmd | SITE SP CHMOD check_login SP octal_number SP pathname CRLF { if ($4 && ($8 != NULL)) { - if ($6 > 0777) + if (($6 == -1) || ($6 > 0777)) reply(501, "CHMOD: Mode value must be between " "0 and 0777"); |