From owner-freebsd-bugs@FreeBSD.ORG Mon Jul 7 13:50:07 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26E141065671 for ; Mon, 7 Jul 2008 13:50:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id ED71A8FC25 for ; Mon, 7 Jul 2008 13:50:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m67Do6gJ083005 for ; Mon, 7 Jul 2008 13:50:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m67Do6D8083003; Mon, 7 Jul 2008 13:50:06 GMT (envelope-from gnats) Resent-Date: Mon, 7 Jul 2008 13:50:06 GMT Resent-Message-Id: <200807071350.m67Do6D8083003@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Sergey Matveychuk Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1827F1065670 for ; Mon, 7 Jul 2008 13:45:26 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 060AC8FC1C for ; Mon, 7 Jul 2008 13:45:26 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m67DjPAc017206 for ; Mon, 7 Jul 2008 13:45:25 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m67DjP6m017205; Mon, 7 Jul 2008 13:45:25 GMT (envelope-from nobody) Message-Id: <200807071345.m67DjP6m017205@www.freebsd.org> Date: Mon, 7 Jul 2008 13:45:25 GMT From: Sergey Matveychuk To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/125370: [ipfw] increase a line buffer limit X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2008 13:50:07 -0000 >Number: 125370 >Category: bin >Synopsis: [ipfw] increase a line buffer limit >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Jul 07 13:50:06 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Sergey Matveychuk >Release: 7.0-STABLE >Organization: Yandex LLC >Environment: FreeBSD xxx 7.0-STABLE FreeBSD 7.0-STABLE #0: Thu Jun 26 14:07:01 MSD 2008 root@xxx:/usr/src/sys/i386/compile/XXX i386 >Description: When ipfw read command from a file it use BUFSIZE (=1024) as a line size limit. We have longer lines in our firewall and there is no reason for the limit really. The patch increase the buffer limit to 4kb. >How-To-Repeat: >Fix: Patch attached with submission follows: --- ipfw2.c.orig 2008-07-07 16:28:20.000000000 +0400 +++ ipfw2.c 2008-07-07 16:28:48.000000000 +0400 @@ -6281,7 +6281,7 @@ ipfw_readfile(int ac, char *av[]) { #define MAX_ARGS 32 - char buf[BUFSIZ]; + char buf[4096]; char *cmd = NULL, *filename = av[ac-1]; int c, lineno=0; FILE *f = NULL; @@ -6383,7 +6383,7 @@ } } - while (fgets(buf, BUFSIZ, f)) { /* read commands */ + while (fgets(buf, sizeof(buf), f)) { /* read commands */ char linename[10]; char *args[1]; >Release-Note: >Audit-Trail: >Unformatted: