All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: grub-devel@gnu.org
Subject: Re: [PATCH] fix detection of non-LUKS CRYPT
Date: Sun, 6 Nov 2016 13:01:02 +0300	[thread overview]
Message-ID: <603e109a-e60a-0d2c-c246-4adaa022caef@gmail.com> (raw)
In-Reply-To: <3abef268-adaf-f324-94aa-6f97f7517ec0@fatooh.org>

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



  reply	other threads:[~2016-11-06 10:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-05  4:58 [PATCH] fix detection of non-LUKS CRYPT Corey Hickey
2016-11-05 12:31 ` Andrei Borzenkov
2016-11-06  7:09   ` Corey Hickey
2016-11-06 10:01     ` Andrei Borzenkov [this message]
2016-11-07  6:48       ` Corey Hickey
2016-11-07 11:04         ` Andrei Borzenkov
2016-11-12  6:29           ` Corey Hickey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=603e109a-e60a-0d2c-c246-4adaa022caef@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.