From patchwork Thu Nov 13 10:59:43 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Rakus X-Patchwork-Id: 22978 Return-Path: X-Original-To: yaboot-devel@ozlabs.org Delivered-To: yaboot-devel@ozlabs.org Received: from mx2.redhat.com (mx2.redhat.com [66.187.237.31]) by ozlabs.org (Postfix) with ESMTP id 490D9DDDF9 for ; Thu, 13 Nov 2008 22:00:19 +1100 (EST) Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id mADB0HDJ006497 for ; Thu, 13 Nov 2008 06:00:17 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id mADB0G7E023535 for ; Thu, 13 Nov 2008 06:00:17 -0500 Received: from dhcp-lab-179.englab.brq.redhat.com (dhcp-lab-179.englab.brq.redhat.com [10.34.33.179]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id mADB0FwF029572 for ; Thu, 13 Nov 2008 06:00:16 -0500 Message-ID: <491C089F.7070400@redhat.com> Date: Thu, 13 Nov 2008 11:59:43 +0100 From: Roman Rakus User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: yaboot-devel@ozlabs.org Subject: long append="..." causes yaboot to reject entire yaboot.conf (MAX_TOKEN too small) X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-BeenThere: yaboot-devel@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Technical and development discussion regarding yaboot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2008 11:00:21 -0000 Hello. /From Will Woods (wwoods@redhat.com )/ """ yaboot's second/cfg.c has: #define MAX_TOKEN 200 When yaboot parses its config file, if it encounters a quoted string (like append="...") longer than MAX_TOKEN, it rejects the entire config. Typical preupgrade usage uses ~250 chars, which means preupgrade currently renders ppc systems unbootable without this patch. Suggest increasing MAX_TOKEN to.. let's say 511. cfg.c does "char buf[MAX_TOKEN+1]", and everyone loves powers of 2. """ Will it be in next release? RR diff -up yaboot-1.3.14/second/cfg.c.bigger-max-token yaboot-1.3.14/second/cfg.c --- yaboot-1.3.14/second/cfg.c.bigger-max-token 2008-11-12 14:39:11.000000000 -0500 +++ yaboot-1.3.14/second/cfg.c 2008-11-12 14:39:17.000000000 -0500 @@ -41,7 +41,7 @@ typedef struct { void *data; } CONFIG; -#define MAX_TOKEN 200 +#define MAX_TOKEN 511 #define MAX_VAR_NAME MAX_TOKEN #define EOF -1