Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UCTYq-0000XV-V8 for mharc-grub-devel@gnu.org; Mon, 04 Mar 2013 06:28:04 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCTYj-0000OS-SV for grub-devel@gnu.org; Mon, 04 Mar 2013 06:28:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCTYi-0003hZ-Bb for grub-devel@gnu.org; Mon, 04 Mar 2013 06:27:57 -0500 Received: from collab.rosalab.ru ([217.199.216.181]:54272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCTYh-0003hH-W8 for grub-devel@gnu.org; Mon, 04 Mar 2013 06:27:56 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by collab.rosalab.ru (Postfix) with ESMTP id BDCD629C333 for ; Mon, 4 Mar 2013 15:27:52 +0400 (MSK) X-Virus-Scanned: amavisd-new at rosalab.ru Received: from collab.rosalab.ru ([127.0.0.1]) by localhost (collab.rosalab.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L7-FY7VnqLRr for ; Mon, 4 Mar 2013 15:27:51 +0400 (MSK) Received: from icedphoenix.localnet (unknown [10.168.1.56]) by collab.rosalab.ru (Postfix) with ESMTPSA id E32B129C316 for ; Mon, 4 Mar 2013 15:27:51 +0400 (MSK) From: Vladimir Testov To: grub-devel@gnu.org Subject: [PATCH] gfxterm: check elements' properties and hadle errors. Date: Mon, 04 Mar 2013 15:27:51 +0400 Message-ID: <3230726.ejrxcKfAuV@icedphoenix> User-Agent: KMail/4.9.4 (Linux/3.5.0-23-generic; KDE/4.9.4; x86_64; ; ) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart30277776.3vJkVcEj6o" Content-Transfer-Encoding: 7Bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 217.199.216.181 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Mar 2013 11:28:03 -0000 This is a multi-part message in MIME format. --nextPart30277776.3vJkVcEj6o Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" GRUB does not show errors about non-existing properties or wrong values. property name and error hadling works only for global properties This patch fixes this misbehavior. -- With best regards, _______________________________ Vladimir Testov, ROSA Laboratory. www.rosalab.ru --nextPart30277776.3vJkVcEj6o Content-Disposition: attachment; filename="grub-2.00-check-properties.patch" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="grub-2.00-check-properties.patch" diff -Naur grub-2.00/grub-core/gfxmenu/gui_box.c grub-patch/grub-core/gfxmenu/gui_box.c --- grub-2.00/grub-core/gfxmenu/gui_box.c 2010-12-01 17:45:43.000000000 +0300 +++ grub-patch/grub-core/gfxmenu/gui_box.c 2013-03-04 14:17:51.423471466 +0400 @@ -300,6 +300,10 @@ else self->id = 0; } + else + { + return GRUB_ERR_IO; + } return grub_errno; } diff -Naur grub-2.00/grub-core/gfxmenu/gui_canvas.c grub-patch/grub-core/gfxmenu/gui_canvas.c --- grub-2.00/grub-core/gfxmenu/gui_canvas.c 2010-12-01 17:45:43.000000000 +0300 +++ grub-patch/grub-core/gfxmenu/gui_canvas.c 2013-03-04 14:16:32.200770137 +0400 @@ -186,6 +186,10 @@ else self->id = 0; } + else + { + return GRUB_ERR_IO; + } return grub_errno; } diff -Naur grub-2.00/grub-core/gfxmenu/gui_circular_progress.c grub-patch/grub-core/gfxmenu/gui_circular_progress.c --- grub-2.00/grub-core/gfxmenu/gui_circular_progress.c 2010-12-01 17:45:43.000000000 +0300 +++ grub-patch/grub-core/gfxmenu/gui_circular_progress.c 2013-03-04 14:15:57.352997914 +0400 @@ -270,6 +270,10 @@ grub_gfxmenu_timeout_register ((grub_gui_component_t) self, circprog_set_state); } + else + { + return GRUB_ERR_IO; + } return grub_errno; } diff -Naur grub-2.00/grub-core/gfxmenu/gui_image.c grub-patch/grub-core/gfxmenu/gui_image.c --- grub-2.00/grub-core/gfxmenu/gui_image.c 2012-02-08 16:41:16.000000000 +0400 +++ grub-patch/grub-core/gfxmenu/gui_image.c 2013-03-04 14:15:17.657499911 +0400 @@ -237,6 +237,10 @@ else self->id = 0; } + else + { + return GRUB_ERR_IO; + } return grub_errno; } diff -Naur grub-2.00/grub-core/gfxmenu/gui_label.c grub-patch/grub-core/gfxmenu/gui_label.c --- grub-2.00/grub-core/gfxmenu/gui_label.c 2012-03-03 16:00:50.000000000 +0400 +++ grub-patch/grub-core/gfxmenu/gui_label.c 2013-03-04 14:14:53.121066492 +0400 @@ -231,6 +231,10 @@ grub_gfxmenu_timeout_register ((grub_gui_component_t) self, label_set_state); } + else + { + return GRUB_ERR_IO; + } return GRUB_ERR_NONE; } diff -Naur grub-2.00/grub-core/gfxmenu/gui_list.c grub-patch/grub-core/gfxmenu/gui_list.c --- grub-2.00/grub-core/gfxmenu/gui_list.c 2011-12-14 14:36:07.000000000 +0400 +++ grub-patch/grub-core/gfxmenu/gui_list.c 2013-03-04 12:54:31.311035573 +0400 @@ -527,6 +527,10 @@ else self->id = 0; } + else + { + return GRUB_ERR_IO; + } return grub_errno; } diff -Naur grub-2.00/grub-core/gfxmenu/gui_progress_bar.c grub-patch/grub-core/gfxmenu/gui_progress_bar.c --- grub-2.00/grub-core/gfxmenu/gui_progress_bar.c 2012-03-10 22:37:48.000000000 +0400 +++ grub-patch/grub-core/gfxmenu/gui_progress_bar.c 2013-03-04 14:16:57.169163072 +0400 @@ -345,6 +345,10 @@ grub_gfxmenu_timeout_register ((grub_gui_component_t) self, progress_bar_set_state); } + else + { + return GRUB_ERR_IO; + } return grub_errno; } diff -Naur grub-2.00/grub-core/gfxmenu/theme_loader.c grub-patch/grub-core/gfxmenu/theme_loader.c --- grub-2.00/grub-core/gfxmenu/theme_loader.c 2012-02-24 14:19:45.000000000 +0400 +++ grub-patch/grub-core/gfxmenu/theme_loader.c 2013-03-04 15:01:36.112753989 +0400 @@ -557,7 +557,16 @@ parse_proportional_spec (value, &component->h, &component->hfrac); else /* General property handling. */ - component->ops->set_property (component, property, value); + { + grub_err_t error = component->ops->set_property (component, property, value); + if (error != GRUB_ERR_NONE) + { + grub_error (GRUB_ERR_IO, + "%s:%d:%d unknown property or wrong value `%s'=`%s'", + p->filename, p->line_num, p->col_num, + property, value); + } + } grub_free (value); grub_free (property); --nextPart30277776.3vJkVcEj6o--