Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KSrGe-0003p1-E0 for mharc-grub-devel@gnu.org; Tue, 12 Aug 2008 06:38:20 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KSrGa-0003m6-Ht for grub-devel@gnu.org; Tue, 12 Aug 2008 06:38:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KSrGW-0003iA-Dg for grub-devel@gnu.org; Tue, 12 Aug 2008 06:38:15 -0400 Received: from [199.232.76.173] (port=59379 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSrGV-0003hv-Gv for grub-devel@gnu.org; Tue, 12 Aug 2008 06:38:12 -0400 Received: from ti-out-0910.google.com ([209.85.142.189]:20466) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KSrGU-0007qV-RC for grub-devel@gnu.org; Tue, 12 Aug 2008 06:38:11 -0400 Received: by ti-out-0910.google.com with SMTP id u5so1213720tia.10 for ; Tue, 12 Aug 2008 03:38:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=M9b9ZdrKZX+TEXFuCCkdFBED/vS/atdkUNgaRk7r5Jo=; b=NVpmGLbFANhF+UvLAX9kIDy5Z83uxV62qgmL6eQIRLbmisczbxGGKR7xh2jt9XqxgJ LCdd26c4jkIgyQnf1O0+OVYuQV86UaKax05a10CnADEeH+Jfb10rkwRpkrJO6mW01BOC 2ey3wMVLtJiPLkkJZfZPmG1pGdacdSGOaX6Zo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=V2cGysOdF1DCTLBlkQUPUX+om//wuqOGamZJ76dE5wFWh9nwxIPCcOOHtzfpxNLwim J+Cjt9rEL75LYiC++jeS43IMIqULl1YQnnHdV+TDjCxvIMkU0rLjYIpq6Zde/AtpN8Gw egBHHIqrfkjfLVl38+Xr/TGkW8v+tmyYOe0ek= Received: by 10.110.28.15 with SMTP id b15mr10933798tib.26.1218537489163; Tue, 12 Aug 2008 03:38:09 -0700 (PDT) Received: by 10.110.16.5 with HTTP; Tue, 12 Aug 2008 03:38:08 -0700 (PDT) Message-ID: Date: Tue, 12 Aug 2008 18:38:08 +0800 From: Bean To: "The development of GRUB 2" In-Reply-To: <20080812101521.GA3022@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080811213240.GF6883@thorin> <20080812085213.GA381@thorin> <20080812101521.GA3022@thorin> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) Subject: Re: Idea: use menu hook to implement the savedefault command X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2008 10:38:17 -0000 On Tue, Aug 12, 2008 at 6:15 PM, Robert Millan wrote: > On Tue, Aug 12, 2008 at 05:38:16PM +0800, Bean wrote: >> On Tue, Aug 12, 2008 at 4:52 PM, Robert Millan wrote: >> > Notice there's already an implementation of a lock command: >> > >> > http://www.mail-archive.com/grub-devel@gnu.org/msg05350.html >> > >> > which, I think, even without password it would satisfy most of the users who >> > want lock/password. I recommend you read that thread before venturing into >> > implement it (Okuji didn't like my initial proposal, and I run out of time >> > to find/implement another approach). >> >> Hi, >> >> I notice an issue with that implementation. For example, if >> menu_lock=1, how do you unlock it ? Remember that "Unlock the menu" is >> an menu item as well, so you can't get to it in the first place, >> unless you also specify text of menu somewhere, or use another >> variable, for example: >> >> set menu_lock=1 >> set menu_unlock_menu=Unlock the menu >> >> Besides, we might need to fine tune auth with scripting, like >> protecting only some of the commands. > > My idea was to implement unlock in scripting. So you could do something like: > > menuentry unlock { > echo Password: > read user_pass > if [ $user_pass = foo ] ; then > unset menu_lock > fi > } > > but Okuji had some objections to this (see the thread I pasted) Hi, I know that, but isn't "unlock" another menu item which would normally be locked by menu_lock ? You can hard coded it to ignore the "unlock" menu, but what if user want to use another name. -- Bean