diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2003-01-25 00:51:41 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2003-01-25 00:51:41 +0000 |
commit | 1b467805f870b1baf707351caad6ae10a5b2b6f5 (patch) | |
tree | c59726978691823b7efdb1645402465b35426c22 /sbin/pfctl | |
parent | 663674abf024fba7e6187239fa66e825f4c9b8c3 (diff) |
if a table name ist too long, it's actually nice to tell so instead of just
aborting with a syntax error
Diffstat (limited to 'sbin/pfctl')
-rw-r--r-- | sbin/pfctl/parse.y | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 41b10b088a1..7563271693b 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.295 2003/01/20 18:37:52 camield Exp $ */ +/* $OpenBSD: parse.y,v 1.296 2003/01/25 00:51:40 henning Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -745,8 +745,11 @@ antispoof_iflst : if_item { $$ = $1; } tabledef : TABLE PORTUNARY STRING PORTUNARY tableopts tableinit { if ($2 != PF_OP_LT || $4 != PF_OP_GT) YYERROR; - if (strlen($3) >= PF_TABLE_NAME_SIZE) + if (strlen($3) >= PF_TABLE_NAME_SIZE) { + yyerror("table name too long, max %d chars", + PF_TABLE_NAME_SIZE - 1); YYERROR; + } pfctl_define_table($3, $5, $6); } ; |