Skip to contentSkip to conversation

fix elilo invocations from the boot manager

PATCH In review Bill Nottingham 2 participants 2 messages Jun 5, 2001 – Jun 7, 2001

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix elilo invocations from the boot manager

In some odd cases, when the boot manager invokes elilo, argc is 0, while Optind is initialized to 1. If we continue with prompting disabled, strange things can happen. (usually, attempts to boot a non-existant kernel.)

Bill

elilo.c +1 -1
diff -ru gnu-efi-2.5/elilo/elilo.c ook/elilo/elilo.c
@@ -373,7 +381,7 @@
 	 * if user specified a kernel name or label, then ignore
 	 * forced interactive mode
 	 */
-	if (argv[Optind]) elilo_opt.prompt = 0;
+	if (argv[Optind] && Optind <= argc) elilo_opt.prompt = 0;
 
 	/*
 	 * which chooser we will use 
#1 lore raw

Bill,

Quoted 5 lines · Bill Nottingham

In some odd cases, when the boot manager invokes elilo, argc is 0, while Optind is initialized to 1. If we continue with prompting disabled, strange things can happen. (usually, attempts to boot a non-existant kernel.)

Thanks for your patch. This comes from the fact that the parameters passed by the caller are in a weird state and confuse the function that converts them into argc/argv form. I have noticed the same thing when booting from the network and that's why I introduce the fixupargs() stage in the main routine.

Signature · 1 line
-Stephane