From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZaP3L-0006wJ-HO for mharc-grub-devel@gnu.org; Fri, 11 Sep 2015 10:11:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaP3I-0006tn-L5 for grub-devel@gnu.org; Fri, 11 Sep 2015 10:11:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZaP3E-00077u-LI for grub-devel@gnu.org; Fri, 11 Sep 2015 10:11:44 -0400 Received: from mail-la0-x22d.google.com ([2a00:1450:4010:c03::22d]:35612) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZaP3E-00077e-DU for grub-devel@gnu.org; Fri, 11 Sep 2015 10:11:40 -0400 Received: by lagj9 with SMTP id j9so49526724lag.2 for ; Fri, 11 Sep 2015 07:11:39 -0700 (PDT) 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-type:content-transfer-encoding; bh=FZ8GMra7bed2/FB1s5mgzOZgaAHOQt1+7KMi3VyVDSU=; b=XZcCAfbxhNgIDojL1vtffyU2i+1FW/JTKh3BHbskE0SJ2JuctpQe1rVv3niXrG469N tCUNqP7dZYpDyzwHyDtXvAJkzM9OPyu7bDTosnjiACjYL9o6NSe49Ql/y9Bp139MUOas WAPcxMODoXyWQZ/j+JTy+788fal/rufoVJ88qd+lM4BK+pIzuOh5Dws5t2NhDBz/gUMU ZFquVHTaI/11a7QBeM+nc+N10KyHu6wnE945q7Swy1d6z8zV4U16o8sIHPlluVxgXX6Y hNdREP9RJ5Yf1mupG3cbIIVwWer2eEslmjtey01/6gSLG8TxCq6zd5A+lBM3D2pzSRbH T92Q== X-Received: by 10.152.6.201 with SMTP id d9mr10180402laa.66.1441980699218; Fri, 11 Sep 2015 07:11:39 -0700 (PDT) Received: from [192.168.1.43] (ppp91-76-134-130.pppoe.mtu-net.ru. [91.76.134.130]) by smtp.gmail.com with ESMTPSA id o1sm80948lag.22.2015.09.11.07.11.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Sep 2015 07:11:38 -0700 (PDT) Subject: Re: cryptodisk: teach grub_cryptodisk_insert() about partitions (bug #45889) To: The development of GNU GRUB References: <55EF0EFB.5060103@gmail.com> From: Andrei Borzenkov Message-ID: <55F2E119.8020302@gmail.com> Date: Fri, 11 Sep 2015 17:11:37 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22d 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: Fri, 11 Sep 2015 14:11:45 -0000 09.09.2015 04:18, TJ пишет: > On 08-09-2015 17:38, Vladimir 'φ-coder/phcoder' Serbinenko wrote: >> On 06.09.2015 21:10, TJ wrote: >>> https://savannah.gnu.org/bugs/index.php?45889 >>> + if ((disk->partition && disk->partition->number == >>> dev->partition_number) || >>> + (!disk->partition && dev->partition_number == 0)) >>> + return dev; >> Please store and compare partition start, not parition number as the >> same partition can be available several times through different partiton >> schemes under different numbers. Additionally this allows to use >> get_partition_start which already has the logic of handling empty >> partitions > > Done and tested. Works perfectly. > Well, should not it also compare disk sizes (grub_disk_get_size)? Also grub_partition_get_start cannot differentiate between full disk (start == 0) and partition that starts at offset 0.