Received: from list by lists.gnu.org with archive (Exim 4.71) id 1gjq1f-0005Ll-IU for mharc-grub-devel@gnu.org; Wed, 16 Jan 2019 13:34:55 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjq1a-0005KD-HW for grub-devel@gnu.org; Wed, 16 Jan 2019 13:34:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjq1Z-0001eJ-Ns for grub-devel@gnu.org; Wed, 16 Jan 2019 13:34:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46430) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gjq1Z-0001dW-Ik for grub-devel@gnu.org; Wed, 16 Jan 2019 13:34:49 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9AF609F73B; Wed, 16 Jan 2019 18:34:48 +0000 (UTC) Received: from prarit.bos.redhat.com (prarit-guest.khw1.lab.eng.bos.redhat.com [10.16.200.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8804F5D967; Wed, 16 Jan 2019 18:34:47 +0000 (UTC) From: Prarit Bhargava To: grub-devel@gnu.org Cc: Prarit Bhargava , mleitner@redhat.com, pjones@redhat.com, javierm@redhat.com, aruiz@redhat.com, Daniel Kiper Subject: [PATCH v2 0/3] grub: add grub variable extend functionality Date: Wed, 16 Jan 2019 13:34:40 -0500 Message-Id: <20190116183443.14978-1-prarit@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 16 Jan 2019 18:34:48 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jan 2019 18:34:54 -0000 This patchset allows a user to update an existing grub variable on the commandline. v2: - Split into 3 patches. - fix "=value" bug. An additional consequence of this is that the value pointer p in set_variable() cannot underflow. - make grub_envblk_iterate return an int and fix return values. - add "+=" functionality - Changes suggested by David Kiper: Change name to grub_envblk_extend(), capitalize comments, use standard GRUB error enum, change goto from "out" to "err", drop cast in grub_strlen() call, use grub_snprintf() instead of strcpy & memcpy. - Instead of parsing envblk separately, use grub_envblk_iterate() - use a case statement in set_variable() error handling, and add a comment about deleting the "=" sign. Signed-off-by: Prarit Bhargava Cc: mleitner@redhat.com Cc: pjones@redhat.com Cc: javierm@redhat.com Cc: aruiz@redhat.com Cc: Daniel Kiper Prarit Bhargava (3): grub-editenv: Verify the variable size grub: Make grub_envblk_iterate() return an int grub: add extend variable functionality grub-core/commands/loadenv.c | 6 +-- grub-core/lib/envblk.c | 17 ++++--- include/grub/err.h | 4 +- include/grub/lib/envblk.h | 6 +-- util/grub-editenv.c | 86 ++++++++++++++++++++++++++++++++++-- 5 files changed, 100 insertions(+), 19 deletions(-) -- 2.17.2