From patchwork Thu Nov 13 10:59:43 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: long append="..." causes yaboot to reject entire yaboot.conf (MAX_TOKEN too small) Date: Thu, 13 Nov 2008 00:59:43 -0000 From: Roman Rakus X-Patchwork-Id: 22978 Message-Id: <491C089F.7070400@redhat.com> To: yaboot-devel@ozlabs.org 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