All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yoshinori K. Okuji" <okuji@enbug.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] implement menu_lock
Date: Tue, 12 Feb 2008 08:41:24 +0100	[thread overview]
Message-ID: <200802120841.24890.okuji@enbug.org> (raw)
In-Reply-To: <20080210205948.GC4916@thorin>

On Sunday 10 February 2008 21:59, Robert Millan wrote:
> I didn't see this;  it was inspired in the "lock" command in GRUB Legacy. 
> But since it only applies to menu, and doesn't lock anything else, I
> thought "menu_lock" would be a good choice.
>
> Since our default state is not to lock the menu, and that would match with
> non-existance of the variable, I think the meaning of the variable should
> be to lock the menu when set.  If we make it mean the opposite, e.g.
> auth=1, what do we do when the variable is not set?
>
> You can observe I've been instructed by your advice not to implement ad-hoc
> features, so I tried to avoid some generic "lock" command that would handle
> multiple things depending on the context.  With my proposed scheme, we
> provide the primitives and user can do just about anything.

First of all, we need an authorization status at the global level anyway, 
because if you can enter into the command line interface, you can bypass 
everything.

Once you accept defining an authorization status, you can write this:

menuentry "Anyone can boot this" {
  multiboot /foo
}

menuentry "Only users who unlocked the menu can boot this" {
  if test $auth != no ; then
    multiboot /bar
  else
    echo You must enter a password before booting this entry.
    # Probably better to have a way to exit with an error here!
  fi
}

menuentry "Only a few selected ones can boot this" {
  echo -n "Password: "
  read password
  if test $password = grubisawesome ; then
    multiboot /baz
  else
    echo The password you entered was wrong.
    # error error
  fi
}

But my feeling is that it would be more powerful to implement a password 
checker as a command. Scripting allows you to perform many things, if GRUB 
provides many commands and control structures, but it looks very tiring to 
implement various features (e.g. various encryption schemes, challenge 
retries, the translation of prompts, and so on).

Okuji



  parent reply	other threads:[~2008-02-12  7:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-10 13:09 [PATCH] implement menu_lock Robert Millan
2008-02-10 13:11 ` Robert Millan
2008-02-10 20:13 ` Yoshinori K. Okuji
2008-02-10 20:59   ` Robert Millan
2008-02-10 21:08     ` Robert Millan
2008-02-12  7:41     ` Yoshinori K. Okuji [this message]
2009-03-08 13:50       ` phcoder

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=200802120841.24890.okuji@enbug.org \
    --to=okuji@enbug.org \
    --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.