From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1c3KGG-0006B9-Aw for mharc-grub-devel@gnu.org; Sun, 06 Nov 2016 05:01:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c3KGD-0006Ao-5w for grub-devel@gnu.org; Sun, 06 Nov 2016 05:01:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c3KGA-0001Fv-5J for grub-devel@gnu.org; Sun, 06 Nov 2016 05:01:09 -0500 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]:35970) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c3KG9-0001Dz-TS for grub-devel@gnu.org; Sun, 06 Nov 2016 05:01:06 -0500 Received: by mail-lf0-x242.google.com with SMTP id o20so7321039lfg.3 for ; Sun, 06 Nov 2016 02:01:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=6nACXsOjcwHcE9c4m5hz0USw+qzJnaZ9KR+T8URR+Zk=; b=UxpVgbfyfaeP7O00Wa3e1uwCLfwflvFiMwcEBWSGVVRtoNPmRDMoCCUa83dhfNdUVM 3VKmsh0HpWGjVw7KzV00WTmYaxIS1vqVQ49gjSJtuYdrDbks0su0XbrUd54v4v5uIWWp dgcCB8VKXRB5+1AfrDz7YSQcsDKWpfm6YJFS2JAxenAKlEK24ZOZgy1ndJvwLWT9JkQg 77/mKf2gF4YMD/vN/QaHOfr5c2z8r8bIcat+QbutrwC9lL3mmC+cU17QRTLdwug24dSk cqn+wleARq582GLkUFZb4apnFkCo/s0K/l0dB1KBKXwdToBGPE9hhfwiMtPiXWlr/4fb ls/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=6nACXsOjcwHcE9c4m5hz0USw+qzJnaZ9KR+T8URR+Zk=; b=IJkFx8XOjDQx+XLLlpBb5dPpuNQObaxe/n6ZckgRpX3B/U7iyLOV6XdufE8vlalgci JIrOB9igWx2YTZKck823NmquXXUOrn9wrY+KDNDEBbiwMDkA6Vm+jcz/v75b/1DOEf4T 9M5d/4ZbnI3Pg3qW3laoWgK5G5pDrqDnM8V3ur7heuZb9/9Bhg3GHqVc7uUB4qizEPjQ JBfDmE/BMmICmZafJrWMe5kILsTkc/PquqHvE+2g5kPLmK2hs2pXg9+8rWHmzJU661Rl XfK5yZz9kcyNYd4fDMZ43eYSQE+VYOSakYYfuXpVT4iXalTjwNZpAoPwofHGOMLz9PaB rdyw== X-Gm-Message-State: ABUngve2HnZxY/G8XMIuKTeHXXsIRHQaDHjjtnS3HKMNFxPjJxTEyGRBQ7Jt4zFaB3Ocyg== X-Received: by 10.25.192.20 with SMTP id q20mr886085lff.5.1478426463889; Sun, 06 Nov 2016 02:01:03 -0800 (PST) Received: from [192.168.1.44] (ppp109-252-90-55.pppoe.spdop.ru. [109.252.90.55]) by smtp.gmail.com with ESMTPSA id 196sm1231145lff.3.2016.11.06.02.01.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 Nov 2016 02:01:02 -0800 (PST) Subject: Re: [PATCH] fix detection of non-LUKS CRYPT To: grub-devel@gnu.org References: <43313b6e-80c2-fafb-286b-47db8b180f6a@fatooh.org> <08fec14a-a356-04c9-b135-80da3005efc3@gmail.com> <3abef268-adaf-f324-94aa-6f97f7517ec0@fatooh.org> From: Andrei Borzenkov Message-ID: <603e109a-e60a-0d2c-c246-4adaa022caef@gmail.com> Date: Sun, 6 Nov 2016 13:01:02 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <3abef268-adaf-f324-94aa-6f97f7517ec0@fatooh.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::242 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: Sun, 06 Nov 2016 10:01:10 -0000 06.11.2016 10:09, Corey Hickey пишет: > On 2016-11-05 05:31, Andrei Borzenkov wrote: >>> diff --git a/grub-core/osdep/devmapper/getroot.c >>> b/grub-core/osdep/devmapper/getroot.c >>> index 72e5582..a13a39c 100644 >>> --- a/grub-core/osdep/devmapper/getroot.c >>> +++ b/grub-core/osdep/devmapper/getroot.c >>> @@ -143,7 +143,7 @@ grub_util_get_dm_abstraction (const char *os_dev) >>> grub_free (uuid); >>> return GRUB_DEV_ABSTRACTION_LVM; >>> } >>> - if (strncmp (uuid, "CRYPT-LUKS1-", 4) == 0) >>> + if (strncmp (uuid, "CRYPT-LUKS1-", 12) == 0 >> >> Committed, thanks! We really need some wrapper around (strncmp (foo, >> "bar", sizeof ("bar") - 1), but for now it is OK as bug fix. > > Excellent, you're welcome. That seemed like the most simple fix. > > I took a stab at adding such a wrapper, but there are a ton of files > that could use it which I won't have a chance at being able to test. I > can send in an untested patch if you want... > Large scale replacement will have to wait until release, but we sure can discuss (and add) macro itself. I'm leaning towards simple #define GRUB_IS_PREFIX(string,prefix) (strncmp((string), #prefix, sizeof (#prefix) - 1) == 0) Any other idea how to make it constant-safe? >> P.S. please in future either use git send-email or attach git >> format-patch to make it easier to apply. Thank you. > > Got it. > > Thanks, > Corey > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel